diff --git a/.clang-format b/.clang-format index b4a1a3cc..c68a0645 100644 --- a/.clang-format +++ b/.clang-format @@ -1,13 +1,13 @@ BasedOnStyle: LLVM IndentWidth: 4 -SortIncludes: false -ColumnLimit: 120 +SortIncludes: false +ColumnLimit: 120 AlignTrailingComments: false AccessModifierOffset: -4 AlignConsecutiveAssignments: true -ReflowComments: false +ReflowComments: false BraceWrapping: - AfterClass: true + AfterClass: true AfterFunction: true BeforeElse: true BeforeCatch: true diff --git a/.gitignore b/.gitignore index f946a116..4b0e039f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,13 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +.vscode/ + +.github/ + +Output/ + +*.vtu + # dependencies /.pnp .pnp.js diff --git a/CITATION.cff b/CITATION.cff index f224badd..a6060804 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ title: GMGPolar -version: 1.0.0 +version: 2.0.0 date-released: "2023-04-14" repository-code: "https://github.com/mknaranja/GMGPolar" url: "https://github.com/mknaranja/GMGPolar" @@ -29,9 +29,12 @@ authors: orcid: "https://orcid.org/0000-0001-8796-8599" - given-names: Allan family-names: Kuhn - affiliation: "German Aerospace Center (DLR)" + affiliation: "German Aerospace Center (DLR)" + - given-names: Julian + family-names: Litz + affiliation: "German Aerospace Center (DLR)" #Contributors -cff-version: 1.0.0 +cff-version: 2.0.0 message: >- If you use this software, please cite it using the metadata from this file. diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index 57ca070b..3c1e59d6 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,121 +1,130 @@ -cmake_minimum_required(VERSION 3.16.3) - -project(GMGPolar VERSION 1.0.0) +cmake_minimum_required(VERSION 3.12) +project(GMGPolar VERSION 2.0.0 LANGUAGES CXX) option(GMGPOLAR_BUILD_TESTS "Build GMGPolar unit tests." ON) -option(GMGPOLAR_USE_MUMPS "Use MUMPS to compute matrix factorizations." OFF) option(GMGPOLAR_USE_LIKWID "Use LIKWID to measure code (regions)." OFF) +option(GMGPOLAR_USE_MUMPS "Use MUMPS to solve linear systems." OFF) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED True) -set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -set(CMAKE_CXX_FLAGS "") -set(CMAKE_LINKER_FLAGS "") - -add_subdirectory(src) - -# code coverage analysis -# Note: this only works under linux and with make -# Ninja creates different directory names which do not work together with this scrupt -# as STREQUAL is case-sensitive https://github.com/TriBITSPub/TriBITS/issues/131, also allow DEBUG as accepted input -option(GMGPOLAR_TEST_COVERAGE "Enable GCov coverage analysis (adds a 'coverage' target)" OFF) - -if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "DEBUG") - if(GMGPOLAR_TEST_COVERAGE) - message(STATUS "Coverage enabled") - include(CodeCoverage) - append_coverage_compiler_flags() - setup_target_for_coverage_lcov( - NAME coverage - EXECUTABLE tests/gmgpolar_tests - EXCLUDE "${CMAKE_SOURCE_DIR}/tests*" "${CMAKE_SOURCE_DIR}/src/test_cases*" "${CMAKE_BINARY_DIR}/*" "/usr*" - ) - endif() +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) endif() - -add_library(GMGPolar ${SOURCES_SRC}) - -add_executable(gmgpolar_simulation ./src/main.cpp) - -configure_file(${CMAKE_SOURCE_DIR}/include/config_internal.h.in ${CMAKE_SOURCE_DIR}/include/config_internal.h) - -target_include_directories(gmgpolar_simulation PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/test_cases ) -target_include_directories(GMGPolar PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/test_cases ) - +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -pedantic -Wno-unused") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -mtune=generic") + +# # Mumps: Sparse Matrix Solver +# set(MUMPS_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/mumps-5.6.2-m4xrhc4mshzrxmgptzbpult3nbf6qrzk") +# include_directories(${MUMPS_PREFIX_PATH}/include) +# link_directories(${MUMPS_PREFIX_PATH}/lib) + +# # Metis: Matrix reordering for Mumps +# set(METIS_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/metis-5.1.0-bgoncx22w55soviybggl5ydjakvkm34v") +# include_directories(${METIS_PREFIX_PATH}/include) +# link_directories(${METIS_PREFIX_PATH}/lib) + +# # Likwid: Performance monitoring +# set(LIKWID_PREFIX_PATH "~/spack/opt/spack/linux-ubuntu20.04-icelake/gcc-9.4.0/likwid-5.3.0-6mvx2snsqnamuyhaqspd6gxkfuaso36g") +# include_directories(${LIKWID_PREFIX_PATH}/include) +# link_directories(${LIKWID_PREFIX_PATH}/lib) + +# Include directories for the project +include_directories(include) + +# 1. Create a library target for the PolarGrid module +file(GLOB_RECURSE POLAR_GRID_SOURCES "src/PolarGrid/*.cpp") +add_library(PolarGrid STATIC ${POLAR_GRID_SOURCES}) +target_include_directories(PolarGrid PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/PolarGrid) + +# 2. Create a library target for the InputFunctions module +file(GLOB_RECURSE INPUT_FUNCTIONS_SOURCES + "src/InputFunctions/DensityProfileCoefficients/*.cpp" + "src/InputFunctions/DomainGeometry/*.cpp" + "src/InputFunctions/ExactSolution/*.cpp" + "src/InputFunctions/BoundaryConditions/*.cpp" + "src/InputFunctions/SourceTerms/*.cpp" +) +add_library(InputFunctions STATIC ${INPUT_FUNCTIONS_SOURCES}) +target_include_directories(InputFunctions PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/InputFunctions) + +# 3. Collect all the common source files for GMGPolar into a library +file(GLOB_RECURSE GMG_POLAR_SOURCES "src/GMGPolar/*.cpp") +file(GLOB_RECURSE MULTIGRID_METHODS_SOURCES "src/GMGPolar/MultigridMethods/*.cpp") +file(GLOB_RECURSE LEVEL_SOURCES "src/Level/*.cpp") +file(GLOB_RECURSE STENCIL_SOURCES "src/Stencil/*.cpp") +file(GLOB_RECURSE INTERPOLATION_SOURCES "src/Interpolation/*.cpp") +file(GLOB_RECURSE DIRECT_SOLVER_SOURCES "src/DirectSolver/*.cpp" "src/DirectSolverGive/*.cpp" "src/DirectSolverTake/*.cpp" "src/DirectSolverGiveCustomLU/*.cpp" "src/DirectSolverTakeCustomLU/*.cpp") +file(GLOB_RECURSE RESIDUAL_SOURCES "src/Residual/*.cpp" "src/Residual/ResidualGive/*.cpp" "src/Residual/ResidualTake/*.cpp") +file(GLOB_RECURSE SMOOTHER_SOURCES "src/Smoother/*.cpp" "src/SmootherGive/*.cpp" "src/SmootherTake/*.cpp") +file(GLOB_RECURSE EXTRAPOLATED_SMOOTHER_SOURCES "src/ExtrapolatedSmoother/*.cpp" "src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/*.cpp" "src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/*.cpp") + +# 4. Create the GMGPolarLib library and link PolarGrid and InputFunctions +add_library(GMGPolarLib STATIC + ${GMG_POLAR_SOURCES} + ${MULTIGRID_METHODS_SOURCES} + ${LEVEL_SOURCES} + ${STENCIL_SOURCES} + ${INTERPOLATION_SOURCES} + ${DIRECT_SOLVER_SOURCES} + ${RESIDUAL_SOURCES} + ${SMOOTHER_SOURCES} + ${EXTRAPOLATED_SMOOTHER_SOURCES} +) +# Link PolarGrid and InputFunctions to GMGPolarLib +target_link_libraries(GMGPolarLib PUBLIC PolarGrid InputFunctions) + +# Link Likwid to GMGPolarLib if(GMGPOLAR_USE_LIKWID) - - find_package(LIKWID REQUIRED) - - target_include_directories(GMGPolar PUBLIC ${LIKWID_INCLUDE_DIRS}) - target_link_libraries(GMGPolar PUBLIC ${LIKWID_LIBRARIES}) - target_compile_definitions(GMGPolar PUBLIC "-DLIKWID_PERFMON") - + target_link_libraries(GMGPolarLib PUBLIC likwid) + target_compile_definitions(GMGPolarLib PUBLIC "-DLIKWID_PERFMON") + add_compile_definitions(GMGPOLAR_USE_LIKWID) endif() - - +# Link Mumps to GMGPolarLib if(GMGPOLAR_USE_MUMPS) - - set(INC_DIRS - /home/kueh_mj/.spack/rev.23.05/install/linux-rocky8-zen2/gcc-10.4.0/mumps-5.4.1-fftqkl/include - /sw/rev/23.05/linux-rocky8-zen2/gcc-10.4.0/metis-5.1.0-akhgsf/include - ) - - set(LIB_DIRS - /home/kueh_mj/.spack/rev.23.05/install/linux-rocky8-zen2/gcc-10.4.0/mumps-5.4.1-fftqkl/lib - /sw/rev/23.05/linux-rocky8-zen2/gcc-10.4.0/metis-5.1.0-akhgsf/lib - ) - - include_directories( - ${INC_DIRS} - ) - - target_link_directories( - GMGPolar - PUBLIC - ${LIB_DIRS} - ) - - set(LIBS - mpiseq - dmumps + set(MUMPS_LIBRARIES mumps_common + smumps + dmumps + mpiseq metis ) - - target_link_libraries( - GMGPolar - PUBLIC - ${LIBS} - ) + target_link_libraries(GMGPolarLib PUBLIC ${MUMPS_LIBRARIES}) + add_compile_definitions(GMGPOLAR_USE_MUMPS) endif() - -find_package(OpenMP) - -#currently works on GNU compiler -if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7)) - - string(APPEND CMAKE_CXX_FLAGS " -O2 -Wall -MMD -MP -Wwrite-strings") - string(APPEND CMAKE_LINKER_FLAGS " -O2 -Wall -MMD -MP -Wwrite-strings") - - if(OPENMP_FOUND) - string(APPEND CMAKE_CXX_FLAGS " -fopenmp") - string(APPEND CMAKE_LINKER_FLAGS " -fopenmp") - - else() - message(FATAL_ERROR "OpenMP needed") - endif() -else() - message(FATAL_ERROR "Please use GNU compiler or change CMakeLists manually") +# Add OpenMP flags if available and link to GMGPolarLib +find_package(OpenMP REQUIRED) +if(OpenMP_CXX_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + target_link_libraries(GMGPolarLib PUBLIC OpenMP::OpenMP_CXX) endif() +# 5. Add the main executable target (gmgpolar) +set(MAIN_SOURCE "src/main.cpp") +add_executable(gmgpolar ${MAIN_SOURCE}) + +# 6. Add another executable target (convergence_order) +set(CONVERGENCE_ORDER_SOURCE "src/convergence_order.cpp") +add_executable(convergence_order ${CONVERGENCE_ORDER_SOURCE}) -target_link_libraries(gmgpolar_simulation PRIVATE GMGPolar) +set(WEAK_SCALING_SOURCE "src/weak_scaling.cpp") +add_executable(weak_scaling ${WEAK_SCALING_SOURCE}) +set(STRONG_SCALING_SOURCE "src/strong_scaling.cpp") +add_executable(strong_scaling ${STRONG_SCALING_SOURCE}) -include(thirdparty/CMakeLists.txt) -add_subdirectory(tests) +# 7. Link GMGPolarLib (which now includes PolarGrid and InputFunctions) to both executables +target_link_libraries(gmgpolar PRIVATE GMGPolarLib) +target_link_libraries(convergence_order PRIVATE GMGPolarLib) +target_link_libraries(weak_scaling PRIVATE GMGPolarLib) +target_link_libraries(strong_scaling PRIVATE GMGPolarLib) +# 9. Enable testing and include other directories +if(GMGPOLAR_BUILD_TESTS) + enable_testing() + add_subdirectory(third-party) + add_subdirectory(tests) +endif() \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 8d057932..b449f067 --- a/README.md +++ b/README.md @@ -7,90 +7,109 @@ If using GMGPolar, please cite: M. J. Kühn, C. Kruse, U. Rüde. Implicitly extrapolated geometric multigrid on disk-like domains for the gyrokinetic Poisson equation from fusion plasma applications. Journal of Scientific Computing, 91 (28). Springer (2022). Link: https://link.springer.com/article/10.1007/s10915-022-01802-1 -Tested plateforms ------------------ +## Obtaining the source code -Working -======= +The GMGPolar Solver can run with or without the sparse direct solver ``MUMPS``, though using MUMPS is recommended for optimal performance. This guide provides instructions on obtaining the code and installing the necessary dependencies. -* Linux x86_64 with GNU 9.3.0 compilers. +## Clone the GMGPolar Repository -Obtaining the source code -------------------------- +To begin, download the latest stable version of GMGPolar by running the following commands in your terminal: -The GmgPolar Solver does not require any external libraries. -It is possible to link the code with the sparse direct solver ``MUMPS``. + # Clone the repository. This will create a directory named GMGPolar. + git clone https://github.com/mknaranja/GMGPolar -* ``MUMPS`` is optional. However, it is absolutely recommended if large grids are considered. - Otherwise, the nonoptimal backup solver will be used for factorization of the matrices and will - slow down the setup phase significantly. To use it, compile the code with option -DGMGPOLAR_USE_MUMPS. - It is recommended to use the latest version (currently 5.4.1) but any version ulterior - to 5.1.0 should be okay. MUMPS is available freely on demand on the MUMPS consortium - website "mumps-solver.org". - -The installation can be done by typing the following commands in your terminal +## Configuring the Solver - # download the latest stable version - # it will create a directory named GMGPolar +After cloning the repository, you'll need to configure the solver for your system. Edit the ``CMakeLists.txt`` file to reflect your system's configuration (e.g., paths to libraries, file names, etc.). - git clone https://github.com/mknaranja/GMGPolar +## Installing MUMPS using Spack -Now that everything is ready, we can compile the solver. -Edit the file ``Makefile.in`` so that it reflects your configuration (path to libraries, file -names, etc). +We highly recommend using Spack to manage and install external dependencies such as MUMPS. The following steps outline the process for installing MUMPS and related tools. +## Step 1: Install Spack -Building the library --------------------- - -The build process is done using CMake: +To install and set up Spack, execute the following commands in your terminal: - # Create build directory - mkdir -p build && cd build - # Configure - cmake .. - # Build - cmake --build . + # Clone the Spack repository + git clone https://github.com/spack/spack.git -Currently, the default build process only supports gnu compiler although Intel compiler -has been successfully tested for some configurations. + # Add Spack to your environment by sourcing its setup script + echo ". $HOME/spack/share/spack/setup-env.sh" >> ~/.bashrc -Running GmgPolar ------------- + # Refresh your terminal or source your .bashrc + source ~/.bashrc -You can run the solver without having to write a code (as we do in the next section). After building -the library, a binary is created called ``./build/gmgpolar_simulation``, it takes parameters directly from command-line. +## Step 2: Install MUMPS - - # To try GmgPolar on a small problem size, without having to write any code, - # ./build/gmgpolar_simulation uses default parameters with a grid 49 x 64. +With Spack set up, you can now install MUMPS. The following command installs version 5.5.1 of MUMPS with specific options that are recommended for GMGPolar: - ./build/gmgpolar_simulation + spack install mumps@5.5.1 + blr_mt=false + complex=false + double=true + float=true + incfort=false + int64=false + metis=true + mpi=false + openmp=true + parmetis=false + ptscotch=false + scotch=false + shared=true - # For more details on the available parameters, see the main.cpp source code. - # You can control the number of OpenMP threads used by changing the environment variable. - # Note that only MUMPS is parallelized at the moment. +### Note on AVX / AVX-512 Compatibility +If your system does not support AVX or AVX-512 instructions (e.g., on AMD processors), install MUMPS with the following command: - export OMP_NUM_THREADS=4 - + spack install mumps target=x86_64 -Executing an example -------------------------------------------------- -Once the library is built, you can run the examples: +## Step 3: Install Required Dependencies - # the verbose option defines the extent of the output +MUMPS relies on other packages like `Metis` for matrix ordering and `Likwid` for performance monitoring. You can install these dependencies using Spack as well: - ./build/gmgpolar_simulation --verbose 2 +1. **Install Metis (Fill-Reducing Matrix Ordering Library)**: + ```bash + spack install metis + ``` - # the option --debug 1 turns on internal debugging and compares the results of the C++ code - # with the results from the previous matlab implementation. - - ./build/gmgpolar_simulation --debug 1 +2. **Install Likwid (Performance Monitoring Tool)**: + ```bash + spack install likwid + ``` + +## Step 4: Configure CMake for GMGPolar + +After installing MUMPS and other dependencies, ensure that the paths to the libraries are correctly set in the CMakeLists.txt file. + +## Final Step: Compiling the GMGPolar Solver + +Once everything is configured, compile the solver by running the following commands: + +```bash +cd scripts +./compile.sh [Debug|Release] +``` + +After executing ./compile.sh [Debug|Release], the script will compile the solver using the specified build type. You can also run ./compile.sh without any arguments afterward, and it will automatically use the last configured build type. + +Currently, the default build process only supports gnu compiler although Intel compiler +has been successfully tested for some configurations. + +## Running GMGPolar + +You can run the solver without having to write a code (as we do in the next section). After building +the library, a binary is created called ``./build/gmgpolar``, it takes parameters directly from command-line. + + # To try GMGPolar on a small problem size, without having to write any code, + # ./build/gmgpolar uses default parameters with a grid 33 x 64. + ./build/gmgpolar + + # For more details on the available parameters, see the scripts/tutorial/run.sh script. + +## Issue tracker -Issue tracker -------------- If you find any bug, didn't understand a step in the documentation, or if you have a feature request, submit your issue on our `Issue Tracker`: https://github.com/mknaranja/GMGPolar/issues @@ -99,10 +118,9 @@ by giving: - reproducible parameters - computing environment (compiler, etc.) +## Release Notes -Release Notes -------------- -* GmgPolar 1.0 +### GMGPolar 1.0.0 1) Working multigrid cycle 2) In-house solver and possibility to link with MUMPS for the smoothing and coarse grid solution 3) Extrapolation strategies: @@ -113,3 +131,40 @@ Release Notes c. Non-default implicit extrapolation with smoothing of all nodes on the finest level [experimental, use with care, convergence cannot be observed with residual] (--extrapolation 2) 6) Optimization of apply_A / build_rhs / apply_prolongation / build_Asc / apply_Asc_ortho + + +### GMGPolar 2.0.0 + +1) **Enhancements and New Class Layout:** +- **Linear Algebra:** + - Introduced custom Vector and SparseMatrix classes. + - Added a (cyclic) Tridiagonal Solver for improved performance and usability. +- **Input Functions:** + - Separated into distinct components: DomainGeometry, BoundaryConditions, SourceTerm, etc. +- **Polar Grid:** + - Indexing is now based on circle/radial smoother. +- **Residual:** + - Improved the residual calculation by addressing the unintuitive behavior that previously applied only to the interior part of the matrix. +- **Direct Solver:** + - Fixed a bug where boundary values were not treated correctly. + - Built matrices to be symmetric, reducing factorization time. +- **Smoother:** + - Separated into extrapolated and standard smoothers. + - Replaced the LU-Decomposition algorithm with the Thomas algorithm for improved efficiency. + +2) **New Features** + +- Introduced W- and F cycles for enhanced solving capabilities. +- Added FMG (Full Multigrid) to obtain improved starting solutions. +- Implemented advanced caching behavior options for the "Give" implementation strategy. +- Added a faster strategy named 'Take,' which is appropriate for cases where memory is less of a constraint, resulting in an 80% increase in memory usage. +- Comprehensive Unit Tests: Integrated Google Unit Tests for all classes, ensuring robust and reliable functionality across the codebase. + +3) **Performance Improvements** + +- Removed the task-based approach, which did not scale well with increasing parallelization. +- Reduced maximum usage by 61.5% by constructing symmetric matrices and utilizing the tridiagonal structure of smoother matrices. + +4) **Updated Features** + +- Added a new LU decomposition solver, allowing users to choose between MUMPS and the in-house solver for greater flexibility and performance. \ No newline at end of file diff --git a/TEST_CART/README b/TEST_CART/README deleted file mode 100644 index 09984cd4..00000000 --- a/TEST_CART/README +++ /dev/null @@ -1,18 +0,0 @@ -# To run with uniform points - -python3 make_points_r.py --R0 1e-5 --R 1 32 r.txt -python3 make_t.py 32 t.txt -sh tmp.sh -python3 plot.py - -# To run with non-uniform points - -python3 make_points_r.py --R0 1e-5 --R 1 32 r.txt -python3 make_t.py 32 t.txt --non_uniform -sh tmp.sh -python3 plot.py - - -# Speedup - -If code is slow use pyccel to accelerate rho_triangularity_logical.py diff --git a/TEST_CART/make_t.py b/TEST_CART/make_t.py deleted file mode 100644 index 5ce2f6f5..00000000 --- a/TEST_CART/make_t.py +++ /dev/null @@ -1,30 +0,0 @@ -from argparse import ArgumentParser -import numpy as np -import sys - -parser = ArgumentParser(description='Tool for generating points') -parser.add_argument('Nc', type=int, help='Number of cells (must be a multiple of 2)') -parser.add_argument('outfile', type=str, help='File where points should be printed') -parser.add_argument('--non_uniform', action = 'store_true', help='Cutoff = pi/4') -args = parser.parse_args() - -N = args.Nc -has_cutoff = args.non_uniform - -if has_cutoff: - cutoff = np.pi/4 -else: - cutoff = 0 - -percent_in = cutoff/np.pi - -n_in = round(2*percent_in*N) -n_out = round((1-percent_in)*N) - -q = [*np.linspace(0, cutoff, n_in//2, endpoint=False), - *np.linspace(cutoff, 2*np.pi-cutoff, n_out, endpoint=False), - *np.linspace(2*np.pi-cutoff, 2*np.pi, n_in//2, endpoint=False)] - -with open('t.txt','w') as f: - for p in q: - print(p, file=f) diff --git a/TEST_CART/plot.py b/TEST_CART/plot.py deleted file mode 100644 index 9c0d5f38..00000000 --- a/TEST_CART/plot.py +++ /dev/null @@ -1,53 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt -import rho_triangularity_logical as mod -import article_setup - -r, q, x, y, f = np.loadtxt('sol_out.txt', unpack=True) -nq = 1 -while r[nq]==r[nq-1]: - nq += 1 -nr = len(q)//nq -r = r.reshape((nr,nq)) -q = q.reshape((nr,nq)) -x = x.reshape((nr,nq)) -y = y.reshape((nr,nq)) -f = f.reshape((nr,nq)) - -x = np.concatenate([x, x[:, :1]], axis=1) -y = np.concatenate([y, y[:, :1]], axis=1) -r = np.concatenate([r, r[:, :1]], axis=1) -q = np.concatenate([q, q[:, :1]], axis=1) -f = np.concatenate([f, f[:, :1]], axis=1) - -exact_func = np.vectorize(mod.phi_exact) -exact = exact_func(r, q, 0.3, 1.4) - -err = f - exact - -def plot_fig(val, title): - fig, ax = plt.subplots(1,1) - - crop_val = max(-val.min(), val.max()) - clevels = np.linspace(-crop_val, crop_val, 101) - im = ax.contourf( x[:,:], y[:,:], val[:,:], clevels, cmap='seismic' ) - for c in im.collections: - c.set_edgecolor('face') - ax.set_xlabel('x') - ax.set_ylabel('y', rotation=0) - cbar = plt.colorbar( im ) - cbar.formatter.set_powerlimits((0,0)) - n1 = 8 - nr = 8 - ax.plot( x[:,::nr], y[:,::nr], '-', color='lightgrey', lw=0.5 ) - ax.plot( x.transpose()[:,::nr], y.transpose()[:,::nr], '-', color='lightgrey', lw=0.5 ) - ax.set_title(title) - plt.tight_layout() - -plot_fig(err, title='Error') -plt.savefig('gmgpolar_czarny_cart_error.png') - -#plot_fig(f, title = 'Calculated solution') -#plot_fig(exact, title = 'Exact solution') - -plt.show() diff --git a/TEST_CART/r.txt b/TEST_CART/r.txt deleted file mode 100644 index 77e67f55..00000000 --- a/TEST_CART/r.txt +++ /dev/null @@ -1,33 +0,0 @@ -1e-05 -0.0312596875 -0.062509375 -0.0937590625 -0.12500875 -0.1562584375 -0.18750812500000003 -0.2187578125 -0.2500075 -0.2812571875 -0.312506875 -0.34375656250000003 -0.37500625000000004 -0.40625593750000005 -0.437505625 -0.4687553125 -0.500005 -0.5312546874999999 -0.562504375 -0.5937540625 -0.62500375 -0.6562534375 -0.687503125 -0.7187528125 -0.7500025 -0.7812521875 -0.812501875 -0.8437515624999999 -0.87500125 -0.9062509375 -0.937500625 -0.9687503125 -1.0 diff --git a/TEST_CART/rho_triangularity_logical.py b/TEST_CART/rho_triangularity_logical.py deleted file mode 100644 index 10f4c0a3..00000000 --- a/TEST_CART/rho_triangularity_logical.py +++ /dev/null @@ -1,78 +0,0 @@ -import numpy - -from pyccel.decorators import pure - - -@pure -def x(s : float, theta : float, map2_epsilon : float, map2_e : float): - return (1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon - - -@pure -def y(s : float, theta : float, map2_epsilon : float, map2_e : float): - return map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - - -@pure -def J_ss(s : float, theta : float, map2_epsilon : float, map2_e : float): - return -numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - - -@pure -def J_st(s : float, theta : float, map2_epsilon : float, map2_e : float): - return s*numpy.sin(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - - -@pure -def J_ts(s : float, theta : float, map2_epsilon : float, map2_e : float): - return map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - - -@pure -def J_tt(s : float, theta : float, map2_epsilon : float, map2_e : float): - return s*(-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - - -@pure -def J_xs(s : float, theta : float, map2_epsilon : float, map2_e : float): - return (map2_epsilon**6*(numpy.sin(theta))**2 - map2_epsilon**6 + 5.0*map2_epsilon**5*s*(numpy.sin(theta))**2*numpy.cos(theta) - 6.0*map2_epsilon**5*s*numpy.cos(theta) + 8.0*map2_epsilon**4*s**2*(numpy.sin(theta))**2*(numpy.cos(theta))**2 - 12.0*map2_epsilon**4*s**2*(numpy.cos(theta))**2 - 8.0*map2_epsilon**4*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.sin(theta))**2 + 8.0*map2_epsilon**4*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0) + 27.0*map2_epsilon**4*(numpy.sin(theta))**2 - 27.0*map2_epsilon**4 + 4.0*map2_epsilon**3*s**3*(numpy.sin(theta))**2*(numpy.cos(theta))**3 - 8.0*map2_epsilon**3*s**3*(numpy.cos(theta))**3 - 26.0*map2_epsilon**3*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.sin(theta))**2*numpy.cos(theta) + 32.0*map2_epsilon**3*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) + 94.0*map2_epsilon**3*s*(numpy.sin(theta))**2*numpy.cos(theta) - 108.0*map2_epsilon**3*s*numpy.cos(theta) - 20.0*map2_epsilon**2*s**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.sin(theta))**2*(numpy.cos(theta))**2 + 32.0*map2_epsilon**2*s**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.cos(theta))**2 + 80.0*map2_epsilon**2*s**2*(numpy.sin(theta))**2*(numpy.cos(theta))**2 - 108.0*map2_epsilon**2*s**2*(numpy.cos(theta))**2 - 48.0*map2_epsilon**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.sin(theta))**2 + 48.0*map2_epsilon**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0) + 67.0*map2_epsilon**2*(numpy.sin(theta))**2 - 67.0*map2_epsilon**2 - 82.0*map2_epsilon*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.sin(theta))**2*numpy.cos(theta) + 96.0*map2_epsilon*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) + 121.0*map2_epsilon*s*(numpy.sin(theta))**2*numpy.cos(theta) - 134.0*map2_epsilon*s*numpy.cos(theta) - 40.0*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.sin(theta))**2 + 40.0*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0) + 41.0*(numpy.sin(theta))**2 - 41.0)/(map2_epsilon**4*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) - 8.0*map2_epsilon**4*numpy.cos(theta) + 4.0*map2_epsilon**3*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.cos(theta))**2 - 32.0*map2_epsilon**3*s*(numpy.cos(theta))**2 + 4.0*map2_epsilon**2*s**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.cos(theta))**3 - 32.0*map2_epsilon**2*s**2*(numpy.cos(theta))**3 + 26.0*map2_epsilon**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) - 48.0*map2_epsilon**2*numpy.cos(theta) + 52.0*map2_epsilon*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*(numpy.cos(theta))**2 - 96.0*map2_epsilon*s*(numpy.cos(theta))**2 + 41.0*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) - 40.0*numpy.cos(theta)) - - -@pure -def J_xt(s : float, theta : float, map2_epsilon : float, map2_e : float): - return (1/2)*(-map2_epsilon**2*numpy.sqrt(4.0 - map2_epsilon**2)*numpy.sin(theta) - 2.0*map2_epsilon*s*numpy.sqrt(4.0 - map2_epsilon**2)*numpy.sin(theta)*numpy.cos(theta) + 2.0*numpy.sqrt(4.0 - map2_epsilon**2)*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta) - numpy.sqrt(4.0 - map2_epsilon**2)*numpy.sin(theta))/(map2_e*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)) - - -@pure -def J_ys(s : float, theta : float, map2_epsilon : float, map2_e : float): - return (map2_epsilon**4*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta) - 6.0*map2_epsilon**4*numpy.sin(theta) + 3.0*map2_epsilon**3*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta)*numpy.cos(theta) - 20.0*map2_epsilon**3*s*numpy.sin(theta)*numpy.cos(theta) + 2.0*map2_epsilon**2*s**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta)*(numpy.cos(theta))**2 - 16.0*map2_epsilon**2*s**2*numpy.sin(theta)*(numpy.cos(theta))**2 + 14.0*map2_epsilon**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta) - 20.0*map2_epsilon**2*numpy.sin(theta) + 23.0*map2_epsilon*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta)*numpy.cos(theta) - 36.0*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta) + 13.0*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.sin(theta) - 14.0*numpy.sin(theta))/(map2_epsilon**4*s + 4.0*map2_epsilon**3*s**2*numpy.cos(theta) + 4.0*map2_epsilon**2*s**3*(numpy.cos(theta))**2 - 6.0*map2_epsilon**2*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0) + 14.0*map2_epsilon**2*s - 12.0*map2_epsilon*s**2*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) + 28.0*map2_epsilon*s**2*numpy.cos(theta) - 14.0*s*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0) + 13.0*s) - - -@pure -def J_yt(s : float, theta : float, map2_epsilon : float, map2_e : float): - return (1/2)*(-numpy.sqrt(4.0 - map2_epsilon**2)*numpy.sqrt(map2_epsilon**2 + 2.0*map2_epsilon*s*numpy.cos(theta) + 1.0)*numpy.cos(theta) + 2.0*numpy.sqrt(4.0 - map2_epsilon**2)*numpy.cos(theta))/(map2_e*s) - - -@pure -def rho_glob(s : float, theta : float, map2_epsilon : float, map2_e : float): - return 0.4096*(1.0 - s)**6*(s + 1.0)**6*numpy.exp(numpy.tanh(20.0*s - 14.0))*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - (-s*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(20.0*(numpy.tanh(20.0*s - 14.0))**2 - 20.0)*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - s*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((1/2)*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(4.0*map2_epsilon*numpy.sin(theta)*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + 2.0*(-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 2.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + 2.0*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 2.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 1/2*(-2.0*map2_epsilon*(numpy.cos(theta))**3/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-2.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 4.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 4.0*map2_e*map2_epsilon*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 1/2*(-2.0*map2_epsilon*(numpy.sin(theta))**2*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))**(3/2) - s*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(0.8192*numpy.pi*map2_epsilon*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2) - 0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) + 0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*numpy.pi*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*numpy.pi*map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 1.6384*(numpy.pi)**2*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(theta)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 4.9152*numpy.pi*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 4.9152*numpy.pi*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + s*(-2.0*map2_epsilon*(numpy.sin(theta))**2*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - s*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(2.0*map2_epsilon*numpy.sin(theta)*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 2.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 2.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + s*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(20.0*(numpy.tanh(20.0*s - 14.0))**2 - 20.0)*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + s*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(-0.8192*numpy.pi*map2_epsilon*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2) - 0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) + 0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 4.0*numpy.pi*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 4.0*numpy.pi*map2_e*map2_epsilon*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 1.6384*(numpy.pi)**2*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(numpy.cos(theta))**2*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 1.6384*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(theta)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 4.9152*(1.0 - s)**6*(s + 1.0)**5*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 9.8304*numpy.pi*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 12.288*(1.0 - s)**6*(s + 1.0)**4*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 4.9152*(1.0 - s)**5*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 9.8304*numpy.pi*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 29.4912*(1.0 - s)**5*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) + 12.288*(1.0 - s)**4*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + s*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((1/2)*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(4.0*map2_epsilon*numpy.sin(theta)*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + 2.0*(-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 2.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + 2.0*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 2.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 1/2*(-2.0*map2_epsilon*(numpy.cos(theta))**3/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-2.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 4.0*map2_e*map2_epsilon**2*s*numpy.sin(theta)*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 4.0*map2_e*map2_epsilon*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 1/2*(-2.0*map2_epsilon*(numpy.sin(theta))**2*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*map2_e*map2_epsilon**2*s*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*map2_epsilon*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))**(3/2) - ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(0.8192*numpy.pi*map2_epsilon*s*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2) - 0.4096*s*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) + 1.6384*(numpy.pi)**2*s*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 0.8192*numpy.pi*s*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(theta)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 0.8192*numpy.pi*s*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*s*(1.0 - s)**6*(s + 1.0)**5*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 4.9152*numpy.pi*s*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 2.4576*s*(1.0 - s)**5*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 4.9152*numpy.pi*s*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*numpy.pi*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 4.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((1/2)*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(-4.0*map2_epsilon*s*(numpy.sin(theta))**2*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + 2.0*(-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 2.0*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 3.0*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 2.0*(numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 2.0*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 1/2*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(2.0*map2_epsilon*s*numpy.sin(theta)*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 4.0*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 2.0*numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 1/2*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(2.0*map2_epsilon*s*(numpy.sin(theta))**3/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 4.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 6.0*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 2.0*numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))**(3/2) + (0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(2.0*map2_epsilon*s*numpy.sin(theta)*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 4.0*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 2.0*numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + (0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((1/2)*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(-4.0*map2_epsilon*s*(numpy.sin(theta))**2*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + 2.0*(-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 2.0*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 3.0*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 2.0*(numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 2.0*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 1/2*((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(2.0*map2_epsilon*s*numpy.sin(theta)*(numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 4.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 4.0*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 2.0*numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 1/2*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(2.0*map2_epsilon*s*(numpy.sin(theta))**3/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 4.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 6.0*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 2.0*numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))**(3/2) + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) + ((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*(-0.8192*numpy.pi*map2_epsilon*s*(1.0 - s)**6*(s + 1.0)**6*(numpy.sin(theta))**2*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2) - 0.4096*s*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 1.6384*(numpy.pi)**2*s*(1.0 - s)**6*(s + 1.0)**6*(numpy.sin(theta))**2*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - 1.6384*numpy.pi*s*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.sin(theta)*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 0.4096*(1.0 - s)**6*(s + 1.0)**6*(-2.0*numpy.pi*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 4.0*numpy.pi*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 6.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))) - (0.4096*(1.0 - s)**6*(s + 1.0)**6*(2.0*numpy.pi*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + 2.0*numpy.pi*map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.cos(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + 0.8192*numpy.pi*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon)*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(theta)/numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) + 2.4576*(1.0 - s)**6*(s + 1.0)**5*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) - 2.4576*(1.0 - s)**5*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon))*(-2.0*map2_epsilon*s*(numpy.sin(theta))**2*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**2 + (-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) - 2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**2*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 2.0*map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*map2_epsilon*s*(numpy.cos(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + (map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(-map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)**(3/2)) + 2.0*map2_e*map2_epsilon**2*s**2*(numpy.sin(theta))**3/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**3*(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - 3.0*map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) - map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0) - (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*numpy.exp(-numpy.tanh(20.0*s - 14.0))/numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))/(s*numpy.sqrt(-((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*(map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - numpy.sin(theta)*numpy.cos(theta)/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2 + ((-map2_e*map2_epsilon*s*(numpy.sin(theta))**2/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.sin(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))*((map2_e*map2_epsilon*s*numpy.sin(theta)*numpy.cos(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))**2*numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)) + map2_e*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))**2 + (numpy.cos(theta))**2/(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0)))) - - -@pure -def rho_pole(s : float, theta : float, map2_epsilon : float, map2_e : float): - return 0.0 - - -@pure -def coeffs1(s : float, theta : float, map2_epsilon : float, map2_e : float): - return numpy.exp(-numpy.tanh(20.0*s - 14.0)) - - -@pure -def coeffs2(s : float, theta : float, map2_epsilon : float, map2_e : float): - return 1.0*numpy.exp(numpy.tanh(20.0*s - 14.0)) - - -@pure -def phi_exact(s : float, theta : float, map2_epsilon : float, map2_e : float): - return 0.4096*(1.0 - s)**6*(s + 1.0)**6*numpy.sin(2.0*numpy.pi*map2_e*s*numpy.sin(theta)/(numpy.sqrt(1.0 - 1/4*map2_epsilon**2)*(2.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))))*numpy.cos(2.0*numpy.pi*(1.0 - numpy.sqrt(map2_epsilon*(map2_epsilon + 2.0*s*numpy.cos(theta)) + 1.0))/map2_epsilon) diff --git a/TEST_CART/tmp.sh b/TEST_CART/tmp.sh deleted file mode 100644 index a13c527d..00000000 --- a/TEST_CART/tmp.sh +++ /dev/null @@ -1 +0,0 @@ -../build_gnu/main -n 4 -a 1 --mod_pk 2 --DirBC_Interior 0 --divideBy2 1 -r 1e-5 --smoother 3 --verbose 2 --debug 0 --extrapolation 1 --optimized 1 --openmp 2 --v1 1 --v2 1 -R 1.0 --prob 7 --maxiter 300 --alpha_coeff 2 --beta_coeff 1 --res_norm 3 --f_grid_r "r.txt" --f_grid_theta "t.txt" --rel_red_conv 1e-11 --f_sol_out sol_out.txt diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake deleted file mode 100644 index 7696b879..00000000 --- a/cmake/CodeCoverage.cmake +++ /dev/null @@ -1,440 +0,0 @@ -# Copyright (c) 2012 - 2017, Lars Bilke -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors -# may be used to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# CHANGES: -# -# 2012-01-31, Lars Bilke -# - Enable Code Coverage -# -# 2013-09-17, Joakim Söderberg -# - Added support for Clang. -# - Some additional usage instructions. -# -# 2016-02-03, Lars Bilke -# - Refactored functions to use named parameters -# -# 2017-06-02, Lars Bilke -# - Merged with modified version from github.com/ufz/ogs -# -# 2019-05-06, Anatolii Kurotych -# - Remove unnecessary --coverage flag -# -# 2019-12-13, FeRD (Frank Dana) -# - Deprecate COVERAGE_LCOVR_EXCLUDES and COVERAGE_GCOVR_EXCLUDES lists in favor -# of tool-agnostic COVERAGE_EXCLUDES variable, or EXCLUDE setup arguments. -# - CMake 3.4+: All excludes can be specified relative to BASE_DIRECTORY -# - All setup functions: accept BASE_DIRECTORY, EXCLUDE list -# - Set lcov basedir with -b argument -# - Add automatic --demangle-cpp in lcovr, if 'c++filt' is available (can be -# overridden with NO_DEMANGLE option in setup_target_for_coverage_lcovr().) -# - Delete output dir, .info file on 'make clean' -# - Remove Python detection, since version mismatches will break gcovr -# - Minor cleanup (lowercase function names, update examples...) -# -# 2019-12-19, FeRD (Frank Dana) -# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets -# -# 2020-01-19, Bob Apthorpe -# - Added gfortran support -# -# 2020-02-17, FeRD (Frank Dana) -# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters -# in EXCLUDEs, and remove manual escaping from gcovr targets -# -# USAGE: -# -# 1. Copy this file into your cmake modules path. -# -# 2. Add the following line to your CMakeLists.txt (best inside an if-condition -# using a CMake option() to enable it just optionally): -# include(CodeCoverage) -# -# 3. Append necessary compiler flags: -# append_coverage_compiler_flags() -# -# 3.a (OPTIONAL) Set appropriate optimization flags, e.g. -O0, -O1 or -Og -# -# 4. If you need to exclude additional directories from the report, specify them -# using full paths in the COVERAGE_EXCLUDES variable before calling -# setup_target_for_coverage_*(). -# Example: -# set(COVERAGE_EXCLUDES -# '${PROJECT_SOURCE_DIR}/src/dir1/*' -# '/path/to/my/src/dir2/*') -# Or, use the EXCLUDE argument to setup_target_for_coverage_*(). -# Example: -# setup_target_for_coverage_lcov( -# NAME coverage -# EXECUTABLE testrunner -# EXCLUDE "${PROJECT_SOURCE_DIR}/src/dir1/*" "/path/to/my/src/dir2/*") -# -# 4.a NOTE: With CMake 3.4+, COVERAGE_EXCLUDES or EXCLUDE can also be set -# relative to the BASE_DIRECTORY (default: PROJECT_SOURCE_DIR) -# Example: -# set(COVERAGE_EXCLUDES "dir1/*") -# setup_target_for_coverage_gcovr_html( -# NAME coverage -# EXECUTABLE testrunner -# BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src" -# EXCLUDE "dir2/*") -# -# 5. Use the functions described below to create a custom make target which -# runs your test executable and produces a code coverage report. -# -# 6. Build a Debug build: -# cmake -DCMAKE_BUILD_TYPE=Debug .. -# make -# make my_coverage_target -# - -include(CMakeParseArguments) - -# Check prereqs -find_program( GCOV_PATH gcov ) -find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl) -find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat ) -find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test) -find_program( CPPFILT_PATH NAMES c++filt ) - -if(NOT GCOV_PATH) - message(FATAL_ERROR "gcov not found! Aborting...") -endif() # NOT GCOV_PATH - -if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") - if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3) - message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") - endif() -elseif(NOT CMAKE_COMPILER_IS_GNUCXX) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang") - # Do nothing; exit conditional without error if true - elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - # Do nothing; exit conditional without error if true - else() - message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") - endif() -endif() - -set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage" - CACHE INTERNAL "") - -set(CMAKE_Fortran_FLAGS_COVERAGE - ${COVERAGE_COMPILER_FLAGS} - CACHE STRING "Flags used by the Fortran compiler during coverage builds." - FORCE ) -set(CMAKE_CXX_FLAGS_COVERAGE - ${COVERAGE_COMPILER_FLAGS} - CACHE STRING "Flags used by the C++ compiler during coverage builds." - FORCE ) -set(CMAKE_C_FLAGS_COVERAGE - ${COVERAGE_COMPILER_FLAGS} - CACHE STRING "Flags used by the C compiler during coverage builds." - FORCE ) -set(CMAKE_EXE_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used for linking binaries during coverage builds." - FORCE ) -set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used by the shared libraries linker during coverage builds." - FORCE ) -mark_as_advanced( - CMAKE_Fortran_FLAGS_COVERAGE - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_C_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) - -if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading") -endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" - -if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - link_libraries(gcov) -endif() - -# Defines a target for running and collection code coverage information -# Builds dependencies, runs the given executable and outputs reports. -# NOTE! The executable should always have a ZERO as exit code otherwise -# the coverage generation will not complete. -# -# setup_target_for_coverage_lcov( -# NAME testrunner_coverage # New target name -# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR -# DEPENDENCIES testrunner # Dependencies to build first -# BASE_DIRECTORY "../" # Base directory for report -# # (defaults to PROJECT_SOURCE_DIR) -# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative -# # to BASE_DIRECTORY, with CMake 3.4+) -# NO_DEMANGLE # Don't demangle C++ symbols -# # even if c++filt is found -# ) -function(setup_target_for_coverage_lcov) - - set(options NO_DEMANGLE) - set(oneValueArgs BASE_DIRECTORY NAME) - set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS) - cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - if(NOT LCOV_PATH) - message(FATAL_ERROR "lcov not found! Aborting...") - endif() # NOT LCOV_PATH - - if(NOT GENHTML_PATH) - message(FATAL_ERROR "genhtml not found! Aborting...") - endif() # NOT GENHTML_PATH - - # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(${Coverage_BASE_DIRECTORY}) - get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() - set(BASEDIR ${PROJECT_SOURCE_DIR}) - endif() - - # Collect excludes (CMake 3.4+: Also compute absolute paths) - set(LCOV_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) - get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() - list(APPEND LCOV_EXCLUDES "${EXCLUDE}") - endforeach() - list(REMOVE_DUPLICATES LCOV_EXCLUDES) - - # Conditional arguments - if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE}) - set(GENHTML_EXTRA_ARGS "--demangle-cpp") - endif() - - message(${LCOV_EXCLUDES}) - - # Setup target - add_custom_target(${Coverage_NAME} - - # Cleanup lcov - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . -b ${BASEDIR} --zerocounters - # Create baseline to make sure untouched files show up in the report - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b ${BASEDIR} -o ${Coverage_NAME}.base - - # Run tests - COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} || exit 0 - - # Capturing lcov counters and generating report - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture - # add baseline counters - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total - # filter collected data to final coverage report - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info - - # Generate HTML output - COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o ${Coverage_NAME} ${Coverage_NAME}.info - - COMMAND ${LCOV_PATH} -l ${Coverage_NAME}.info - - # Set output files as GENERATED (will be removed on 'make clean') - BYPRODUCTS - ${Coverage_NAME}.base - ${Coverage_NAME}.capture - ${Coverage_NAME}.total - ${Coverage_NAME}.info - # ${Coverage_NAME} # report directory - - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM - COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." - ) - - # Show where to find the lcov info report - #add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - # COMMAND ; - # COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info." - #) - - # Show info where to find the report - #add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - # COMMAND ; - # COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." - #) - -endfunction() # setup_target_for_coverage_lcov - -# Defines a target for running and collection code coverage information -# Builds dependencies, runs the given executable and outputs reports. -# NOTE! The executable should always have a ZERO as exit code otherwise -# the coverage generation will not complete. -# -# setup_target_for_coverage_gcovr_xml( -# NAME ctest_coverage # New target name -# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR -# DEPENDENCIES executable_target # Dependencies to build first -# BASE_DIRECTORY "../" # Base directory for report -# # (defaults to PROJECT_SOURCE_DIR) -# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative -# # to BASE_DIRECTORY, with CMake 3.4+) -# ) -function(setup_target_for_coverage_gcovr_xml) - - set(options NONE) - set(oneValueArgs BASE_DIRECTORY NAME) - set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) - cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - if(NOT GCOVR_PATH) - message(FATAL_ERROR "gcovr not found! Aborting...") - endif() # NOT GCOVR_PATH - - # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(${Coverage_BASE_DIRECTORY}) - get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() - set(BASEDIR ${PROJECT_SOURCE_DIR}) - endif() - - # Collect excludes (CMake 3.4+: Also compute absolute paths) - set(GCOVR_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) - get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() - list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") - endforeach() - list(REMOVE_DUPLICATES GCOVR_EXCLUDES) - - # Combine excludes to several -e arguments - set(GCOVR_EXCLUDE_ARGS "") - foreach(EXCLUDE ${GCOVR_EXCLUDES}) - list(APPEND GCOVR_EXCLUDE_ARGS "-e") - list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") - endforeach() - - add_custom_target(${Coverage_NAME} - # Run tests - ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} - - # Running gcovr - COMMAND ${GCOVR_PATH} --xml - -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS} - --object-directory=${PROJECT_BINARY_DIR} - -o ${Coverage_NAME}.xml - BYPRODUCTS ${Coverage_NAME}.xml - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM # Protect arguments to commands - COMMENT "Running gcovr to produce Cobertura code coverage report." - ) - - # Show info where to find the report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND ; - COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml." - ) -endfunction() # setup_target_for_coverage_gcovr_xml - -# Defines a target for running and collection code coverage information -# Builds dependencies, runs the given executable and outputs reports. -# NOTE! The executable should always have a ZERO as exit code otherwise -# the coverage generation will not complete. -# -# setup_target_for_coverage_gcovr_html( -# NAME ctest_coverage # New target name -# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR -# DEPENDENCIES executable_target # Dependencies to build first -# BASE_DIRECTORY "../" # Base directory for report -# # (defaults to PROJECT_SOURCE_DIR) -# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative -# # to BASE_DIRECTORY, with CMake 3.4+) -# ) -function(setup_target_for_coverage_gcovr_html) - - set(options NONE) - set(oneValueArgs BASE_DIRECTORY NAME) - set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) - cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - if(NOT GCOVR_PATH) - message(FATAL_ERROR "gcovr not found! Aborting...") - endif() # NOT GCOVR_PATH - - # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(${Coverage_BASE_DIRECTORY}) - get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() - set(BASEDIR ${PROJECT_SOURCE_DIR}) - endif() - - # Collect excludes (CMake 3.4+: Also compute absolute paths) - set(GCOVR_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) - get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() - list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") - endforeach() - list(REMOVE_DUPLICATES GCOVR_EXCLUDES) - - # Combine excludes to several -e arguments - set(GCOVR_EXCLUDE_ARGS "") - foreach(EXCLUDE ${GCOVR_EXCLUDES}) - list(APPEND GCOVR_EXCLUDE_ARGS "-e") - list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") - endforeach() - - add_custom_target(${Coverage_NAME} - # Run tests - ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} - - # Create folder - COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME} - - # Running gcovr - COMMAND ${GCOVR_PATH} --html --html-details - -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS} - --object-directory=${PROJECT_BINARY_DIR} - -o ${Coverage_NAME}/index.html - - BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM # Protect arguments to commands - COMMENT "Running gcovr to produce HTML code coverage report." - ) - - # Show info where to find the report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND ; - COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." - ) - -endfunction() # setup_target_for_coverage_gcovr_html - -function(append_coverage_compiler_flags) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) - message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}") -endfunction() # append_coverage_compiler_flags diff --git a/generation_files/generate.py b/generation_files/generate.py deleted file mode 100644 index 2e7333b9..00000000 --- a/generation_files/generate.py +++ /dev/null @@ -1,97 +0,0 @@ -import os -import shutil -import subprocess - -culham_folder = '/home/emily/Code/culham-metric' -current_folder = os.path.dirname(__file__) - -python_folder = os.path.join(culham_folder, 'poisson_code', 'tests', 'python_code') - -qn_functions_file = os.path.join(python_folder, 'qn_functions.py') - -qn_gen_file = os.path.join(python_folder, 'main_qn_analytical.py') - -wrap_to_c = os.path.join(current_folder, 'wrap_c_to_class.py') - -out_folder = os.path.join(current_folder, 'out') - -src_folder = os.path.join(current_folder, '..', 'src') - -include_folder = os.path.join(current_folder, '..', 'include') - -PYTHON = shutil.which('python3') - -problems = { - 'CartesianR2' : '( 1 - s**2 ) * sp.cos( 2*sp.pi*x ) * sp.sin( 2*sp.pi*y )', - 'PolarR6' : '1e-4 * s**6*(s-1)**6/(0.5**12) * sp.cos( 11 * t )', - 'CartesianR6' : '1e-4 * (s+1)**6 * (s-1)**6/(0.5**12) * sp.cos( 2*sp.pi*x ) * sp.sin( 2*sp.pi*y )', - } - -coeffs = { - 'Sonnendrucker' : '2/(2.6 + 3.14)*(1.3 + sp.atan( (1-1.3*s)/0.09 ))', - 'Zoni' : 'sp.exp( - sp.tanh( ( s - 0.5 ) / 0.1 ) )', - 'ZoniShifted' : 'sp.exp( - sp.tanh( ( s - 0.7 ) / 0.05 ) )' - } - -geometry = { - 'Circular': 'circle', - 'Shafranov': 'shafranov', - 'Triangular': 'triangularity' - } - -for c, coeff_a in coeffs.items(): - for beta in (True, False): - coeff_b = '1/({})'.format(coeff_a) if beta else '0.0' - for p, phi in problems.items(): - for g, geom in geometry.items(): - classname = p+('Gyro' if beta else '')+c+g - print("Generating : ",classname) - with open(qn_functions_file, "w") as f: - print("import sympy as sp", file=f) - print("", file=f) - print("def phi_exact(s,t,x,y):", file=f) - print(f" return {phi}", file=f) - print("", file=f) - print("def coeffs1(s,t):", file=f) - print(f" return {coeff_a}", file=f) - print("", file=f) - print("def coeffs2(s,t):", file=f) - print(f" return {coeff_b}", file=f) - cmd = [PYTHON, qn_gen_file, 'cpp', '--mapping', geom, '--output', os.path.join(out_folder, classname), '--vectorise', '--Rmax'] - exc = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True) - out, err = exc.communicate() - assert(exc.returncode==0) - - shutil.move(os.path.join(out_folder, classname+'.h'), os.path.join(include_folder, classname+'.h')) - shutil.move(os.path.join(out_folder, classname+'.cpp'), os.path.join(src_folder, classname+'.cpp')) - - shutil.rmtree(out_folder) - -c = 'Poisson' -coeff_a = '0.0' -coeff_b = '0.0' -for p, phi in problems.items(): - for g, geom in geometry.items(): - classname = p+c+g - print("Generating : ",classname) - with open(qn_functions_file, "w") as f: - print("import sympy as sp", file=f) - print("", file=f) - print("def phi_exact(s,t,x,y):", file=f) - print(f" return {phi}", file=f) - print("", file=f) - print("def coeffs1(s,t):", file=f) - print(f" return {coeff_a}", file=f) - print("", file=f) - print("def coeffs2(s,t):", file=f) - print(f" return {coeff_b}", file=f) - cmd = [PYTHON, qn_gen_file, 'cpp', '--mapping', geom, '--output', os.path.join(out_folder, classname), '--vectorise', '--Rmax'] - exc = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True) - out, err = exc.communicate() - assert(exc.returncode==0) - - shutil.move(os.path.join(out_folder, classname+'.h'), os.path.join(include_folder, classname+'.h')) - shutil.move(os.path.join(out_folder, classname+'.cpp'), os.path.join(src_folder, classname+'.cpp')) - - shutil.rmtree('out') - diff --git a/include/DirectSolver/DirectSolverGive/directSolverGive.h b/include/DirectSolver/DirectSolverGive/directSolverGive.h new file mode 100644 index 00000000..3dcd6459 --- /dev/null +++ b/include/DirectSolver/DirectSolverGive/directSolverGive.h @@ -0,0 +1,91 @@ +#pragma once + +#include "../directSolver.h" + +#ifdef GMGPOLAR_USE_MUMPS + + #include "dmumps_c.h" + #include "mpi.h" + +class DirectSolverGive : public DirectSolver +{ +public: + explicit DirectSolverGive(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + + ~DirectSolverGive() override; + // Note: The rhs (right-hand side) vector gets overwritten during the solution process. + void solveInPlace(Vector& solution) override; + +private: + // Solver matrix and MUMPS solver structure + SparseMatrixCOO solver_matrix_; + DMUMPS_STRUC_C mumps_solver_; + + // clang-format off + const Stencil stencil_interior_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + const Stencil stencil_across_origin_ = { + -1, 4, 6, + 1, 0, 2, + -1, 3, 5 + }; + const Stencil stencil_DB_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + const Stencil stencil_next_inner_DB_ = { + -1, 3, 5, + -1, 0, 1, + -1, 2, 4 + }; + const Stencil stencil_next_outer_DB_ = { + 5, 3, -1, + 1, 0, -1, + 4, 2, -1 + }; + // clang-format on + + // Constructs a symmetric solver matrix. + SparseMatrixCOO buildSolverMatrix(); + void buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO& solver_matrix); + void buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCOO& solver_matrix); + + // Initializes the MUMPS solver with the specified matrix. + // Converts to 1-based indexing. + void initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix); + + // Adjusts the right-hand side vector for symmetry corrections. + // This modifies the system from + // A * solution = rhs + // to the equivalent system + // symmetric_DBc(A) * solution = rhs - applySymmetryShift(rhs). + // The correction modifies the rhs to account for the influence of the Dirichlet boundary conditions, + // ensuring that the solution at the boundary is correctly adjusted and maintains the required symmetry. + void applySymmetryShift(Vector& rhs) const; + void applySymmetryShiftInnerBoundary(Vector& x) const; + void applySymmetryShiftOuterBoundary(Vector& x) const; + + // Solves the adjusted system symmetric(matrixA) * solution = rhs using the MUMPS solver. + void solveWithMumps(Vector& solution); + + // Finalizes the MUMPS solver, releasing any allocated resources. + void finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver); + + // Returns the total number of non-zero elements in the solver matrix. + int getNonZeroCountSolverMatrix() const; + + // Returns the index of the first non-zero element in the solver matrix for the given position. + int getSolverMatrixIndex(int i_r, int i_theta) const; + + // Retrieves the stencil for the solver matrix at the given radial index. + const Stencil& getStencil(int i_r) const; +}; + +#endif \ No newline at end of file diff --git a/include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h b/include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h new file mode 100644 index 00000000..5752c151 --- /dev/null +++ b/include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h @@ -0,0 +1,60 @@ +#pragma once + +#include "../directSolver.h" + +class DirectSolverGiveCustomLU : public DirectSolver +{ +public: + explicit DirectSolverGiveCustomLU(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + bool DirBC_Interior, int num_omp_threads); + + ~DirectSolverGiveCustomLU() override; + // Note: The rhs (right-hand side) vector gets overwritten with the solution. + void solveInPlace(Vector& solution) override; + +private: + // Solver matrix and solver structure + SparseMatrixCSR solver_matrix_; + SparseLUSolver lu_solver_; + + // clang-format off + const Stencil stencil_interior_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + const Stencil stencil_across_origin_ = { + -1, 4, 6, + 1, 0, 2, + -1, 3, 5 + }; + const Stencil stencil_DB_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + const Stencil stencil_next_inner_DB_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + const Stencil stencil_next_outer_DB_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + // clang-format on + + SparseMatrixCSR buildSolverMatrix(); + void buildSolverMatrixCircleSection(const int i_r, SparseMatrixCSR& solver_matrix); + void buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCSR& solver_matrix); + + // Returns the total number of non-zero elements in the solver matrix. + int getNonZeroCountSolverMatrix() const; + // Retrieves the stencil for the solver matrix at the given radial index. + const Stencil& getStencil(int i_r) const; + + int getStencilSize(int global_index) const; +}; diff --git a/include/DirectSolver/DirectSolverTake/directSolverTake.h b/include/DirectSolver/DirectSolverTake/directSolverTake.h new file mode 100644 index 00000000..614764d4 --- /dev/null +++ b/include/DirectSolver/DirectSolverTake/directSolverTake.h @@ -0,0 +1,91 @@ +#pragma once + +#include "../directSolver.h" + +#ifdef GMGPOLAR_USE_MUMPS + + #include "dmumps_c.h" + #include "mpi.h" + +class DirectSolverTake : public DirectSolver +{ +public: + explicit DirectSolverTake(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + + ~DirectSolverTake() override; + // Note: The rhs (right-hand side) vector gets overwritten during the solution process. + void solveInPlace(Vector& solution) override; + +private: + // Solver matrix and MUMPS solver structure + SparseMatrixCOO solver_matrix_; + DMUMPS_STRUC_C mumps_solver_; + + // clang-format off + const Stencil stencil_interior_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + const Stencil stencil_across_origin_ = { + -1, 4, 6, + 1, 0, 2, + -1, 3, 5 + }; + const Stencil stencil_DB_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + const Stencil stencil_next_inner_DB_ = { + -1, 3, 5, + -1, 0, 1, + -1, 2, 4 + }; + const Stencil stencil_next_outer_DB_ = { + 5, 3, -1, + 1, 0, -1, + 4, 2, -1 + }; + // clang-format on + + // Constructs a symmetric solver matrix. + SparseMatrixCOO buildSolverMatrix(); + void buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO& solver_matrix); + void buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCOO& solver_matrix); + + // Initializes the MUMPS solver with the specified matrix. + // Converts to 1-based indexing. + void initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix); + + // Adjusts the right-hand side vector for symmetry corrections. + // This modifies the system from + // A * solution = rhs + // to the equivalent system + // symmetric_DBc(A) * solution = rhs - applySymmetryShift(rhs). + // The correction modifies the rhs to account for the influence of the Dirichlet boundary conditions, + // ensuring that the solution at the boundary is correctly adjusted and maintains the required symmetry. + void applySymmetryShift(Vector& rhs) const; + void applySymmetryShiftInnerBoundary(Vector& x) const; + void applySymmetryShiftOuterBoundary(Vector& x) const; + + // Solves the adjusted system symmetric(matrixA) * solution = rhs using the MUMPS solver. + void solveWithMumps(Vector& solution); + + // Finalizes the MUMPS solver, releasing any allocated resources. + void finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver); + + // Returns the total number of non-zero elements in the solver matrix. + int getNonZeroCountSolverMatrix() const; + + // Returns the index of the first non-zero element in the solver matrix for the given position. + int getSolverMatrixIndex(int i_r, int i_theta) const; + + // Retrieves the stencil for the solver matrix at the given radial index. + const Stencil& getStencil(int i_r) const; +}; + +#endif \ No newline at end of file diff --git a/include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h b/include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h new file mode 100644 index 00000000..8084fe13 --- /dev/null +++ b/include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h @@ -0,0 +1,60 @@ +#pragma once + +#include "../directSolver.h" + +class DirectSolverTakeCustomLU : public DirectSolver +{ +public: + explicit DirectSolverTakeCustomLU(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + bool DirBC_Interior, int num_omp_threads); + + ~DirectSolverTakeCustomLU() override; + // Note: The rhs (right-hand side) vector gets overwritten with the solution. + void solveInPlace(Vector& solution) override; + +private: + // Solver matrix and solver structure + SparseMatrixCSR solver_matrix_; + SparseLUSolver lu_solver_; + + // clang-format off + const Stencil stencil_interior_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + const Stencil stencil_across_origin_ = { + -1, 4, 6, + 1, 0, 2, + -1, 3, 5 + }; + const Stencil stencil_DB_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + const Stencil stencil_next_inner_DB_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + const Stencil stencil_next_outer_DB_ = { + 7, 4, 8, + 1, 0, 2, + 5, 3, 6 + }; + // clang-format on + + SparseMatrixCSR buildSolverMatrix(); + void buildSolverMatrixCircleSection(const int i_r, SparseMatrixCSR& solver_matrix); + void buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCSR& solver_matrix); + + // Returns the total number of non-zero elements in the solver matrix. + int getNonZeroCountSolverMatrix() const; + // Retrieves the stencil for the solver matrix at the given radial index. + const Stencil& getStencil(int i_r) const; + + int getStencilSize(int global_index) const; +}; diff --git a/include/DirectSolver/directSolver.h b/include/DirectSolver/directSolver.h new file mode 100644 index 00000000..3b3e766f --- /dev/null +++ b/include/DirectSolver/directSolver.h @@ -0,0 +1,41 @@ +#pragma once + +class LevelCache; +class Level; + +#include +#include +#include + +#include "../InputFunctions/domainGeometry.h" +#include "../InputFunctions/densityProfileCoefficients.h" +#include "../Level/level.h" +#include "../PolarGrid/polargrid.h" +#include "../common/global_definitions.h" +#include "../LinearAlgebra/vector.h" +#include "../LinearAlgebra/vector_operations.h" +#include "../LinearAlgebra/coo_matrix.h" +#include "../LinearAlgebra/csr_matrix.h" +#include "../LinearAlgebra/sparseLUSolver.h" +#include "../Stencil/stencil.h" + +class DirectSolver +{ +public: + explicit DirectSolver(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + + virtual ~DirectSolver() = default; + + // Note: The rhs (right-hand side) vector gets overwritten during the solution process. + virtual void solveInPlace(Vector& solution) = 0; + +protected: + const PolarGrid& grid_; + const LevelCache& level_cache_; + const DomainGeometry& domain_geometry_; + const DensityProfileCoefficients& density_profile_coefficients_; + const bool DirBC_Interior_; + const int num_omp_threads_; +}; diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h new file mode 100644 index 00000000..d83cebd0 --- /dev/null +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h @@ -0,0 +1,89 @@ +#pragma once + +#include "../extrapolatedSmoother.h" + +#ifdef GMGPOLAR_USE_MUMPS + #include "dmumps_c.h" + #include "mpi.h" +#endif + +class ExtrapolatedSmootherGive : public ExtrapolatedSmoother +{ +public: + explicit ExtrapolatedSmootherGive(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + bool DirBC_Interior, int num_omp_threads); + + ~ExtrapolatedSmootherGive() override; + + void extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) override; + +private: + void extrapolatedSmoothingSequential(Vector& x, const Vector& rhs, Vector& temp); + void extrapolatedSmoothingForLoop(Vector& x, const Vector& rhs, + Vector& temp); /* This is the fastest option */ + + void extrapolatedSmoothingTaskLoop(Vector& x, const Vector& rhs, Vector& temp); + void extrapolatedSmoothingTaskDependencies(Vector& x, const Vector& rhs, Vector& temp); + + // The A_sc matrix on i_r = 0 is defined through the COO/CSR matrix + // 'inner_boundary_circle_matrix_' due to the across-origin treatment. + // It isn't tridiagonal and thus it requires a more advanced solver. + // Note that circle_tridiagonal_solver_[0] is thus unused! + + // Lines containing coarse nodes are purely diagonal and thus are not stored in tridiagonal format. + // - 'circle_tridiagonal_solver_[index] refers to the circular line i_r = 2*index, + // - 'circle_diagonal_solver_[index] refers to the circular line i_r = 2*index + 1, + // - 'radial_tridiagonal_solver_[index] refers to the radial line i_theta = 2*index, + // - 'radial_diagonal_solver_[index] refers to the radial line i_theta = 2*index + 1. +#ifdef GMGPOLAR_USE_MUMPS + SparseMatrixCOO inner_boundary_circle_matrix_; + DMUMPS_STRUC_C inner_boundary_mumps_solver_; +#else + SparseMatrixCSR inner_boundary_circle_matrix_; + SparseLUSolver inner_boundary_lu_solver_; +#endif + std::vector> circle_diagonal_solver_; + std::vector> radial_diagonal_solver_; + std::vector> circle_tridiagonal_solver_; + std::vector> radial_tridiagonal_solver_; + + // clang-format off + Stencil stencil_center_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + Stencil stencil_center_left_ = { + -1, -1, -1, + 1, 0, -1, + -1, -1, -1 + }; + // clang-format on + + const Stencil& getStencil(int i_r, int i_theta) const; + int getNonZeroCountCircleAsc(const int i_r) const; + int getNonZeroCountRadialAsc(const int i_theta) const; + + int getCircleAscIndex(const int i_r, const int i_theta) const; + int getRadialAscIndex(const int i_r, const int i_theta) const; + + void buildAscMatrices(); + void buildAscCircleSection(const int i_r); + void buildAscRadialSection(const int i_theta); + + void applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + void applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + + void solveCircleSection(const int i_r, Vector& x, Vector& temp, Vector& solver_storage_1, + Vector& solver_storage_2); + void solveRadialSection(const int i_theta, Vector& x, Vector& temp, Vector& solver_storage); + +#ifdef GMGPOLAR_USE_MUMPS + void initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix); + void finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver); +#endif +}; diff --git a/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h new file mode 100644 index 00000000..31c99f38 --- /dev/null +++ b/include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h @@ -0,0 +1,82 @@ +#pragma once + +#include "../extrapolatedSmoother.h" + +#ifdef GMGPOLAR_USE_MUMPS + #include "dmumps_c.h" + #include "mpi.h" +#endif + +class ExtrapolatedSmootherTake : public ExtrapolatedSmoother +{ +public: + explicit ExtrapolatedSmootherTake(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + bool DirBC_Interior, int num_omp_threads); + + ~ExtrapolatedSmootherTake() override; + + void extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) override; + +private: + // The A_sc matrix on i_r = 0 is defined through the COO/CSR matrix + // 'inner_boundary_circle_matrix_' due to the across-origin treatment. + // It isn't tridiagonal and thus it requires a more advanced solver. + // Note that circle_tridiagonal_solver_[0] is thus unused! + + // Lines containing coarse nodes are purely diagonal and thus are not stored in tridiagonal format. + // - 'circle_tridiagonal_solver_[index] refers to the circular line i_r = 2*index, + // - 'circle_diagonal_solver_[index] refers to the circular line i_r = 2*index + 1, + // - 'radial_tridiagonal_solver_[index] refers to the radial line i_theta = 2*index, + // - 'radial_diagonal_solver_[index] refers to the radial line i_theta = 2*index + 1. +#ifdef GMGPOLAR_USE_MUMPS + SparseMatrixCOO inner_boundary_circle_matrix_; + DMUMPS_STRUC_C inner_boundary_mumps_solver_; +#else + SparseMatrixCSR inner_boundary_circle_matrix_; + SparseLUSolver inner_boundary_lu_solver_; +#endif + std::vector> circle_diagonal_solver_; + std::vector> radial_diagonal_solver_; + std::vector> circle_tridiagonal_solver_; + std::vector> radial_tridiagonal_solver_; + + // clang-format off + Stencil stencil_center_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + Stencil stencil_center_left_ = { + -1, -1, -1, + 1, 0, -1, + -1, -1, -1 + }; + // clang-format on + + const Stencil& getStencil(int i_r, int i_theta) const; + int getNonZeroCountCircleAsc(const int i_r) const; + int getNonZeroCountRadialAsc(const int i_theta) const; + + int getCircleAscIndex(const int i_r, const int i_theta) const; + int getRadialAscIndex(const int i_r, const int i_theta) const; + + void buildAscMatrices(); + void buildAscCircleSection(const int i_r); + void buildAscRadialSection(const int i_theta); + + void applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + void applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + + void solveCircleSection(const int i_r, Vector& x, Vector& temp, Vector& solver_storage_1, + Vector& solver_storage_2); + void solveRadialSection(const int i_theta, Vector& x, Vector& temp, Vector& solver_storage); + +#ifdef GMGPOLAR_USE_MUMPS + void initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix); + void finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver); +#endif +}; diff --git a/include/ExtrapolatedSmoother/extrapolatedSmoother.h b/include/ExtrapolatedSmoother/extrapolatedSmoother.h new file mode 100644 index 00000000..22ad7d64 --- /dev/null +++ b/include/ExtrapolatedSmoother/extrapolatedSmoother.h @@ -0,0 +1,42 @@ +#pragma once + +class LevelCache; +class Level; + +#include +#include +#include + +#include "../InputFunctions/domainGeometry.h" +#include "../LinearAlgebra/diagonalSolver.h" +#include "../LinearAlgebra/coo_matrix.h" +#include "../LinearAlgebra/csr_matrix.h" +#include "../LinearAlgebra/sparseLUSolver.h" +#include "../LinearAlgebra/symmetricTridiagonalSolver.h" +#include "../LinearAlgebra/vector.h" +#include "../LinearAlgebra/vector_operations.h" +#include "../PolarGrid/polargrid.h" + +#include "../Level/level.h" +#include "../Stencil/stencil.h" +#include "../common/global_definitions.h" + +class ExtrapolatedSmoother +{ +public: + explicit ExtrapolatedSmoother(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + virtual ~ExtrapolatedSmoother() = default; + + virtual void extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) = 0; + +protected: + const PolarGrid& grid_; + const LevelCache& level_cache_; + const DomainGeometry& domain_geometry_; + const DensityProfileCoefficients& density_profile_coefficients_; + const bool DirBC_Interior_; + const int num_omp_threads_; +}; diff --git a/include/GMGPolar/gmgpolar.h b/include/GMGPolar/gmgpolar.h new file mode 100644 index 00000000..fa09fbdb --- /dev/null +++ b/include/GMGPolar/gmgpolar.h @@ -0,0 +1,302 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +class Level; +class LevelCache; + +#include "../InputFunctions/boundaryConditions.h" +#include "../InputFunctions/densityProfileCoefficients.h" +#include "../InputFunctions/domainGeometry.h" +#include "../InputFunctions/exactSolution.h" +#include "../InputFunctions/sourceTerm.h" +#include "../Interpolation/interpolation.h" +#include "../Level/level.h" +#include "../LinearAlgebra/vector.h" +#include "../LinearAlgebra/vector_operations.h" +#include "../PolarGrid/polargrid.h" +#include "../Utilities/cmdline.h" +#include "../common/global_definitions.h" +#include "test_cases.h" + +class GMGPolar +{ +public: + /* ------------------------ */ + /* GMGPoloar initialization */ + GMGPolar(); + GMGPolar(std::unique_ptr domain_geometry, + std::unique_ptr density_profile_coefficients, + std::unique_ptr boundary_conditions, + std::unique_ptr source_term); + + void setParameters(int argc, char* argv[]); + void setSolution(std::unique_ptr exact_solution); + + /* ---------------------- */ + /* GMGPolar Setup & Solve */ + void setup(); + void solve(); + + /* ----------------- */ + /* GMGPolar Solution */ + Vector& solution(); + const Vector& solution() const; + const PolarGrid& grid() const; + + /* Solve Properties */ + int numberOfIterations() const; + double meanResidualReductionFactor() const; + // Only when exact solution provided + std::optional exactErrorWeightedEuclidean() const; + std::optional exactErrorInfinity() const; + + /* --------------- */ + /* Grid Parameters */ + double R0() const; + void R0(double R0); + double Rmax() const; + void Rmax(double Rmax); + + int nr_exp() const; + void nr_exp(int nr_exp); + int ntheta_exp() const; + void ntheta_exp(int ntheta_exp); + + int anisotropic_factor() const; + void anisotropic_factor(int anisotropic_factor); + int divideBy2() const; + void divideBy2(int divideBy2); + + bool write_grid_file() const; + void write_grid_file(bool write_grid_file); + bool load_grid_file() const; + void load_grid_file(bool load_grid_file); + + std::string file_grid_radii() const; + void file_grid_radii(const std::string& file_name); + std::string file_grid_angles() const; + void file_grid_angles(const std::string& file_name); + + /* ------------------- */ + /* Geometry Parameters */ + bool DirBC_Interior() const; + void DirBC_Interior(bool DirBC_Interior); + + /* -------------------- */ + /* Multigrid Parameters */ + bool FMG() const; + void FMG(bool FMG); + int FMG_iterations() const; + void FMG_iterations(int FMG_iterations); + MultigridCycleType FMG_cycle() const; + void FMG_cycle(MultigridCycleType FMG_cycle); + + ExtrapolationType extrapolation() const; + void extrapolation(ExtrapolationType extrapolation); + + int maxLevels() const; + void maxLevels(int max_levels); + MultigridCycleType multigridCycle() const; + void multigridCycle(MultigridCycleType multigrid_cycle); + + int preSmoothingSteps() const; + void preSmoothingSteps(int pre_smoothing_steps); + int postSmoothingSteps() const; + void postSmoothingSteps(int post_smoothing_steps); + + int maxIterations() const; + void maxIterations(int max_iterations); + ResidualNormType residualNormType() const; + void residualNormType(ResidualNormType residual_norm_type); + double absoluteTolerance() const; + void absoluteTolerance(double absolute_tolerance); + double relativeTolerance() const; + void relativeTolerance(double relative_tolerance); + + /* ------------------ */ + /* Control Parameters */ + int verbose() const; + void verbose(int verbose); + bool paraview() const; + void paraview(bool paraview); + int maxOpenMPThreads() const; + void maxOpenMPThreads(int max_omp_threads); + double threadReductionFactor() const; + void threadReductionFactor(double thread_reduction_factor); + StencilDistributionMethod stencilDistributionMethod() const; + void stencilDistributionMethod(StencilDistributionMethod stencil_distribution_method); + bool cacheDensityProfileCoefficients() const; + void cacheDensityProfileCoefficients(bool cache_density_profile_coefficients); + bool cacheDomainGeometry() const; + void cacheDomainGeometry(bool cache_domain_geometry); + + /* --------*/ + /* Timings */ + void printTimings() const; + void resetTimings(); + + double t_setup_total; + double t_setup_createLevels; + double t_setup_rhs; + double t_setup_smoother; + double t_setup_directSolver; + + double t_solve_total; + double t_solve_initial_approximation; + double t_solve_multigrid_iterations; + double t_check_convergence; + double t_check_exact_error; + + double t_avg_MGC_total; + double t_avg_MGC_preSmoothing; + double t_avg_MGC_postSmoothing; + double t_avg_MGC_residual; + double t_avg_MGC_directSolver; + +private: + /* --------------- */ + /* Grid Parameters */ + double R0_; + double Rmax_; + int nr_exp_; + int ntheta_exp_; + int anisotropic_factor_; + int divideBy2_; + bool write_grid_file_; + bool load_grid_file_; + std::string file_grid_radii_; + std::string file_grid_angles_; + /* ------------------- */ + /* Geometry Parameters */ + bool DirBC_Interior_; + /* ---------- */ + /* Test Cases */ + GeometryType geometry_; + double kappa_eps_; + double delta_e_; + ProblemType problem_; + AlphaCoeff alpha_; + double alpha_jump_; + BetaCoeff beta_; + /* -------------------- */ + /* Multigrid Parameters */ + bool FMG_; + int FMG_iterations_; + MultigridCycleType FMG_cycle_; + ExtrapolationType extrapolation_; + int max_levels_; + int pre_smoothing_steps_; + int post_smoothing_steps_; + MultigridCycleType multigrid_cycle_; + int max_iterations_; + ResidualNormType residual_norm_type_; + std::optional absolute_tolerance_; + std::optional relative_tolerance_; + /* ------------------ */ + /* Control Parameters */ + int verbose_; + bool paraview_; + int max_omp_threads_; + double thread_reduction_factor_; + StencilDistributionMethod stencil_distribution_method_; + // `cache_density_profile_coefficients_` caches alpha(r_i), beta(r_i) + bool cache_density_profile_coefficients_; + // `cache_domain_geometry_` caches transformation coefficients (arr, att, art) used in the Jacobian of the domain geometry mapping. + bool cache_domain_geometry_; + + /* --------------- */ + /* Input Functions */ + std::unique_ptr domain_geometry_; + std::unique_ptr density_profile_coefficients_; + std::unique_ptr boundary_conditions_; + std::unique_ptr source_term_; + std::unique_ptr exact_solution_ = nullptr; // Optional exact solution for validation + + /* ------------------------------ */ + /* Parser for GMGPolar parameters */ + cmdline::parser parser_; + + /* ---------------- */ + /* Multigrid levels */ + int number_of_levels_; + std::vector levels_; + std::vector threads_per_level_; + + std::unique_ptr interpolation_; + + /* Chooses if full grid smoothing is active on level 0 for extrapolation > 0. */ + bool full_grid_smoothing_ = false; + + /* -------------------- */ + /* Convergence criteria */ + int number_of_iterations_; + std::vector residual_norms_; + double mean_residual_reduction_factor_; + bool converged(const double& current_residual_norm, const double& first_residual_norm); + + std::vector> exact_errors_; // Only when exact solution provided + std::pair computeExactError(Level& level, const Vector& solution, Vector& error); + + /* ---------------------------------------- */ + /* Parser Functions for GMGPolar Parameters */ + void initializeGrid(); + void initializeGeometry(); + void initializeMultigrid(); + void initializeGeneral(); + + void parseGrid(); + void parseGeometry(); + void parseMultigrid(); + void parseGeneral(); + + void selectTestCase(); + + /* --------------- */ + /* Setup Functions */ + PolarGrid createFinestGrid(); + int chooseNumberOfLevels(const PolarGrid& finest_grid); + + void build_rhs_f(const Level& level, Vector& rhs_f); + void discretize_rhs_f(const Level& level, Vector& rhs_f); + + /* --------------- */ + /* Solve Functions */ + void initializeSolution(); + + /* ------------------- */ + /* Multigrid Functions */ + void multigrid_V_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual); + void multigrid_W_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual); + void multigrid_F_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual); + void implicitlyExtrapolatedMultigrid_V_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual); + void implicitlyExtrapolatedMultigrid_W_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual); + void implicitlyExtrapolatedMultigrid_F_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual); + + void prolongation(const int current_level, Vector& result, const Vector& x) const; + void restriction(const int current_level, Vector& result, const Vector& x) const; + void injection(const int current_level, Vector& result, const Vector& x) const; + void extrapolatedProlongation(const int current_level, Vector& result, const Vector& x) const; + void extrapolatedRestriction(const int current_level, Vector& result, const Vector& x) const; + void FMGInterpolation(const int current_level, Vector& result, const Vector& x) const; + + void extrapolatedResidual(const int current_level, Vector& residual, + const Vector& residual_next_level); + + /* ------------- */ + /* Visualization */ + void writeToVTK(const std::filesystem::path& file_path, const PolarGrid& grid); + void writeToVTK(const std::filesystem::path& file_path, const Level& level, const Vector& grid_function); +}; \ No newline at end of file diff --git a/include/GMGPolar/test_cases.h b/include/GMGPolar/test_cases.h new file mode 100644 index 00000000..ef1000e6 --- /dev/null +++ b/include/GMGPolar/test_cases.h @@ -0,0 +1,140 @@ +#pragma once + +#include "../InputFunctions/boundaryConditions.h" +#include "../InputFunctions/densityProfileCoefficients.h" +#include "../InputFunctions/domainGeometry.h" +#include "../InputFunctions/exactSolution.h" +#include "../InputFunctions/sourceTerm.h" + +/* ---------- */ +/* Test Cases */ +/* ---------- */ + +/* --------------- */ +/* Domain Geometry */ +#include "../include/InputFunctions/DomainGeometry/circularGeometry.h" +#include "../include/InputFunctions/DomainGeometry/culhamGeometry.h" +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" +#include "../include/InputFunctions/DomainGeometry/shafranovGeometry.h" + +/* --------------- */ +/* Exact Solutions */ +#include "../include/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.h" +#include "../include/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.h" +#include "../include/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.h" +#include "../include/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.h" +#include "../include/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.h" +#include "../include/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.h" +#include "../include/InputFunctions/ExactSolution/polarR6_CircularGeometry.h" +#include "../include/InputFunctions/ExactSolution/polarR6_CulhamGeometry.h" +#include "../include/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.h" +#include "../include/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.h" +#include "../include/InputFunctions/ExactSolution/refined_CircularGeometry.h" +#include "../include/InputFunctions/ExactSolution/refined_CulhamGeometry.h" +#include "../include/InputFunctions/ExactSolution/refined_CzarnyGeometry.h" +#include "../include/InputFunctions/ExactSolution/refined_ShafranovGeometry.h" + +/* ------------------- */ +/* Boundary Conditions */ +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.h" + +/* -----------------------------*/ +/* Density Profile Coefficients */ +#include "../include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h" +#include "../include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h" +#include "../include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h" + +/* ------------------------- */ +/* Source Terms: CartesianR2 */ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h" +/* ------------------------- */ +/* Source Terms: CartesianR6 */ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h" +/* --------------------- */ +/* Source Terms: PolarR6 */ +#include "../include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h" /* Culham */ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h" + +/* --------------------- */ +/* Source Terms: Refined */ +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h" +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h" /* Culham */ +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h" +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h" \ No newline at end of file diff --git a/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h b/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h new file mode 100644 index 00000000..9399bcff --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class CartesianR2_Boundary_CircularGeometry : public BoundaryConditions +{ +public: + CartesianR2_Boundary_CircularGeometry() = default; + explicit CartesianR2_Boundary_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_Boundary_CircularGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.h b/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.h new file mode 100644 index 00000000..d9852573 --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class CartesianR2_Boundary_CzarnyGeometry : public BoundaryConditions +{ +public: + explicit CartesianR2_Boundary_CzarnyGeometry(); + explicit CartesianR2_Boundary_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~CartesianR2_Boundary_CzarnyGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.h b/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.h new file mode 100644 index 00000000..5b51db0a --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class CartesianR2_Boundary_ShafranovGeometry : public BoundaryConditions +{ +public: + CartesianR2_Boundary_ShafranovGeometry() = default; + explicit CartesianR2_Boundary_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_Boundary_ShafranovGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.h b/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.h new file mode 100644 index 00000000..b329f732 --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class CartesianR6_Boundary_CircularGeometry : public BoundaryConditions +{ +public: + CartesianR6_Boundary_CircularGeometry() = default; + explicit CartesianR6_Boundary_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_Boundary_CircularGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.h b/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.h new file mode 100644 index 00000000..1b36a2e4 --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class CartesianR6_Boundary_CzarnyGeometry : public BoundaryConditions +{ +public: + explicit CartesianR6_Boundary_CzarnyGeometry(); + explicit CartesianR6_Boundary_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~CartesianR6_Boundary_CzarnyGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h b/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h new file mode 100644 index 00000000..4a07fee3 --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class CartesianR6_Boundary_ShafranovGeometry : public BoundaryConditions +{ +public: + CartesianR6_Boundary_ShafranovGeometry() = default; + explicit CartesianR6_Boundary_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_Boundary_ShafranovGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.h b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.h new file mode 100644 index 00000000..2d1a1a1c --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class PolarR6_Boundary_CircularGeometry : public BoundaryConditions +{ +public: + PolarR6_Boundary_CircularGeometry() = default; + explicit PolarR6_Boundary_CircularGeometry(const double& Rmax); + virtual ~PolarR6_Boundary_CircularGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.h b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.h new file mode 100644 index 00000000..1d206416 --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class PolarR6_Boundary_CulhamGeometry : public BoundaryConditions +{ +public: + PolarR6_Boundary_CulhamGeometry() = default; + explicit PolarR6_Boundary_CulhamGeometry(const double& Rmax); + virtual ~PolarR6_Boundary_CulhamGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h new file mode 100644 index 00000000..4238e4cf --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class PolarR6_Boundary_CzarnyGeometry : public BoundaryConditions +{ +public: + explicit PolarR6_Boundary_CzarnyGeometry(); + explicit PolarR6_Boundary_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~PolarR6_Boundary_CzarnyGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.h b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.h new file mode 100644 index 00000000..da16066d --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class PolarR6_Boundary_ShafranovGeometry : public BoundaryConditions +{ +public: + PolarR6_Boundary_ShafranovGeometry() = default; + explicit PolarR6_Boundary_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_Boundary_ShafranovGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.h b/include/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.h new file mode 100644 index 00000000..46800cba --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class Refined_Boundary_CircularGeometry : public BoundaryConditions +{ +public: + Refined_Boundary_CircularGeometry() = default; + explicit Refined_Boundary_CircularGeometry(const double& Rmax); + virtual ~Refined_Boundary_CircularGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h b/include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h new file mode 100644 index 00000000..fb7504e1 --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class Refined_Boundary_CulhamGeometry : public BoundaryConditions +{ +public: + Refined_Boundary_CulhamGeometry() = default; + explicit Refined_Boundary_CulhamGeometry(const double& Rmax); + virtual ~Refined_Boundary_CulhamGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.h b/include/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.h new file mode 100644 index 00000000..188320ec --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class Refined_Boundary_CzarnyGeometry : public BoundaryConditions +{ +public: + explicit Refined_Boundary_CzarnyGeometry(); + explicit Refined_Boundary_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~Refined_Boundary_CzarnyGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.h b/include/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.h new file mode 100644 index 00000000..6194aada --- /dev/null +++ b/include/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +#include "../boundaryConditions.h" + +class Refined_Boundary_ShafranovGeometry : public BoundaryConditions +{ +public: + Refined_Boundary_ShafranovGeometry() = default; + explicit Refined_Boundary_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~Refined_Boundary_ShafranovGeometry() = default; + + double u_D(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h new file mode 100644 index 00000000..d2fa59f3 --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class PoissonCoefficients : public DensityProfileCoefficients +{ +public: + PoissonCoefficients() = default; + explicit PoissonCoefficients(const double& Rmax, const double& alpha); + virtual ~PoissonCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.5 * 1.3; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h new file mode 100644 index 00000000..05187041 --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class SonnendruckerCoefficients : public DensityProfileCoefficients +{ +public: + SonnendruckerCoefficients() = default; + explicit SonnendruckerCoefficients(const double& Rmax, const double& alpha); + virtual ~SonnendruckerCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.66 * 1.3; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h new file mode 100644 index 00000000..39d4f778 --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class SonnendruckerGyroCoefficients : public DensityProfileCoefficients +{ +public: + SonnendruckerGyroCoefficients() = default; + explicit SonnendruckerGyroCoefficients(const double& Rmax, const double& alpha); + virtual ~SonnendruckerGyroCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.66 * 1.3; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h new file mode 100644 index 00000000..c9216e5e --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class ZoniCoefficients : public DensityProfileCoefficients +{ +public: + ZoniCoefficients() = default; + explicit ZoniCoefficients(const double& Rmax, const double& alpha); + virtual ~ZoniCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.4837 * 1.3; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h new file mode 100644 index 00000000..b70bfecf --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class ZoniGyroCoefficients : public DensityProfileCoefficients +{ +public: + ZoniGyroCoefficients() = default; + explicit ZoniGyroCoefficients(const double& Rmax, const double& alpha); + virtual ~ZoniGyroCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.4837 * 1.3; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h new file mode 100644 index 00000000..7c83d0bc --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class ZoniShiftedCoefficients : public DensityProfileCoefficients +{ +public: + ZoniShiftedCoefficients() = default; + explicit ZoniShiftedCoefficients(const double& Rmax, const double& alpha); + virtual ~ZoniShiftedCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.7081 * 1.3; +}; diff --git a/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h new file mode 100644 index 00000000..a3509fa6 --- /dev/null +++ b/include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../densityProfileCoefficients.h" + +class ZoniShiftedGyroCoefficients : public DensityProfileCoefficients +{ +public: + ZoniShiftedGyroCoefficients() = default; + explicit ZoniShiftedGyroCoefficients(const double& Rmax, const double& alpha); + virtual ~ZoniShiftedGyroCoefficients() = default; + + double alpha(const double& r) const override; + double beta(const double& r) const override; + + double getAlphaJump() const override; + +private: + const double Rmax = 1.3; + const double alpha_jump = 0.7081 * 1.3; +}; diff --git a/include/InputFunctions/DomainGeometry/circularGeometry.h b/include/InputFunctions/DomainGeometry/circularGeometry.h new file mode 100644 index 00000000..e2000b4a --- /dev/null +++ b/include/InputFunctions/DomainGeometry/circularGeometry.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +#include "../domainGeometry.h" + +class CircularGeometry : public DomainGeometry +{ +public: + CircularGeometry() = default; + explicit CircularGeometry(const double& Rmax); + + virtual ~CircularGeometry() = default; + + double Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double dFx_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFx_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; + +#include "circularGeometry.inl" \ No newline at end of file diff --git a/include/InputFunctions/DomainGeometry/circularGeometry.inl b/include/InputFunctions/DomainGeometry/circularGeometry.inl new file mode 100644 index 00000000..89ee5853 --- /dev/null +++ b/include/InputFunctions/DomainGeometry/circularGeometry.inl @@ -0,0 +1,34 @@ +#pragma once + +#include "circularGeometry.h" + +// In earlier versions denoted by 'x' +inline double CircularGeometry::Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (r/Rmax) * cos_theta; +} + +// In earlier versions denoted by 'y' +inline double CircularGeometry::Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (r/Rmax) * sin_theta; +} + + +// In earlier versions denoted by 'Jrr' +inline double CircularGeometry::dFx_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (cos_theta) / Rmax; +} + +// In earlier versions denoted by 'Jtr' +inline double CircularGeometry::dFy_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (sin_theta) / Rmax; +} + +// In earlier versions denoted by 'Jrt' +inline double CircularGeometry::dFx_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (-(r/Rmax)) * sin_theta; +} + +// In earlier versions denoted by 'Jtt' +inline double CircularGeometry::dFy_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (r/Rmax) * cos_theta; +} diff --git a/include/InputFunctions/DomainGeometry/culhamGeometry.h b/include/InputFunctions/DomainGeometry/culhamGeometry.h new file mode 100644 index 00000000..e3bf7086 --- /dev/null +++ b/include/InputFunctions/DomainGeometry/culhamGeometry.h @@ -0,0 +1,102 @@ +#pragma once + +#include +#include +#include +#include + +#include "../domainGeometry.h" + +class CulhamGeometry : public DomainGeometry +{ +public: + CulhamGeometry(); + explicit CulhamGeometry(const double& Rmax); + + virtual ~CulhamGeometry() = default; + + double Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double dFx_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFx_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + + void initializeGeometry(); + + double my_sum(std::array& f, int64_t start_idx, int64_t end_idx) const; + double q(double rr) const; + double dq(double rr) const; + double p(double rr) const; + double dp(double rr) const; + double dg(double rr, double g) const; + double double_deriv(double rr, double c, double g, double dg, double val, double d_val) const; + double g(double rr) const; + double Delta(double rr) const; + double Delta_prime(double rr) const; + double E(double rr) const; + double T(double rr) const; + double E_prime(double rr) const; + double T_prime(double rr) const; + double P(double rr) const; + double dP(double rr) const; + + double rr; + double dr; + double dr_h; + std::array r; + int64_t i; + double dg_1; + double dE_1; + double dT_1; + double ddE_1; + double ddT_1; + double r2; + double g_2; + double dg_2; + double E_2; + double T_2; + double dE_2; + double dT_2; + double ddE_2; + double ddT_2; + double g_3; + double dg_3; + double E_3; + double T_3; + double dE_3; + double dT_3; + double ddE_3; + double ddT_3; + double g_4; + double dg_4; + double E_4; + double T_4; + double dE_4; + double dT_4; + double ddE_4; + double ddT_4; + double current_Ea; + double current_Ta; + std::array f; + std::array integ_contents; + double integral; + double current_Delta_a; + size_t i_0001; + std::array g_array; + std::array Delta_array; + std::array Delta_prime_array; + std::array E_array; + std::array T_array; + std::array E_prime_array; + std::array T_prime_array; +}; + +#include "culhamGeometry.inl" \ No newline at end of file diff --git a/include/InputFunctions/DomainGeometry/culhamGeometry.inl b/include/InputFunctions/DomainGeometry/culhamGeometry.inl new file mode 100644 index 00000000..9cfb262c --- /dev/null +++ b/include/InputFunctions/DomainGeometry/culhamGeometry.inl @@ -0,0 +1,249 @@ +#pragma once + +#include "culhamGeometry.h" + +// In earlier versions denoted by 'x' +inline double CulhamGeometry::Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + const double cos_two_theta = 1.0 - sin_theta * sin_theta; + return (r/Rmax) * cos_theta + Delta((r/Rmax)) - E((r/Rmax)) * cos_theta - P((r/Rmax)) * cos_theta + T((r/Rmax)) * cos_two_theta + 5.0; +} + +// In earlier versions denoted by 'y' +inline double CulhamGeometry::Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + const double sin_two_theta = 2.0 * sin_theta * cos_theta; + return (r/Rmax) * sin_theta - E((r/Rmax)) * sin_theta - P((r/Rmax)) * sin_theta - T((r/Rmax)) * sin_two_theta; +} + + +// In earlier versions denoted by 'Jrr' +inline double CulhamGeometry::dFx_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + const double cos_two_theta = 1.0 - sin_theta * sin_theta; + return (Delta_prime((r/Rmax)) - E_prime((r/Rmax)) * cos_theta + T_prime((r/Rmax)) * cos_two_theta - dP((r/Rmax)) * cos_theta + cos_theta)/Rmax; +} + +// In earlier versions denoted by 'Jtr' +inline double CulhamGeometry::dFy_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + const double sin_two_theta = 2.0 * sin_theta * cos_theta; + return ((-E_prime((r/Rmax))) * sin_theta - T_prime((r/Rmax)) * sin_two_theta - dP((r/Rmax)) * sin_theta + sin_theta)/Rmax; +} + +// In earlier versions denoted by 'Jrt' +inline double CulhamGeometry::dFx_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + const double sin_two_theta = 2.0 * sin_theta * cos_theta; + return (-(r/Rmax)) * sin_theta + E((r/Rmax)) * sin_theta + P((r/Rmax)) * sin_theta - 2.0 * T((r/Rmax)) * sin_two_theta; +} + +// In earlier versions denoted by 'Jtt' +inline double CulhamGeometry::dFy_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + const double cos_two_theta = 1.0 - sin_theta * sin_theta; + return (r/Rmax) * cos_theta - E((r/Rmax)) * cos_theta - P((r/Rmax)) * cos_theta - 2.0 * T((r/Rmax)) * cos_two_theta; +} + + + +inline double CulhamGeometry::my_sum(std::array& f, int64_t start_idx, int64_t end_idx) const +{ + int64_t i; + double result; + result = 0.0; + #pragma omp parallel for reduction(+: result) + for (i = start_idx; i < end_idx; i += 1) + { + result += f[i]; + } + return result; +} + +inline double CulhamGeometry::q(double rr) const +{ + return 0.8 - 0.1 * (rr * rr); +} + +inline double CulhamGeometry::dq(double rr) const +{ + return (-0.2) * rr; +} + +inline double CulhamGeometry::p(double rr) const +{ + return 100000.0 - 90000.0 * (rr * rr); +} + +inline double CulhamGeometry::dp(double rr) const +{ + return (-180000.0) * rr; +} + +inline double CulhamGeometry::dg(double rr, double g) const +{ + return ((-g) * (0.0625000000000001 * (rr * rr) / pow((1.0 - 0.125 * (rr * rr)), 2.0) + 2.0 / (4.0 - 0.5 * (rr * rr))) + 2.261946711816e-06 * (4.0 - 0.5 * (rr * rr)) / g) / (rr / (4.0 - 0.5 * (rr * rr)) + (4.0 - 0.5 * (rr * rr)) / (g * rr)); +} + +inline double CulhamGeometry::double_deriv(double rr, double c, double g, double dg, double val, double d_val) const +{ + return c * val / (rr * rr) - d_val * (pow(rr, (double)((-1))) + (4.0 - 0.5 * (rr * rr)) * (2.0 * dg * rr / (4.0 - 0.5 * (rr * rr)) + 0.125 * g * (rr * rr) / pow((1.0 - 0.125 * (rr * rr)), 2.0) + 2.0 * g / (4.0 - 0.5 * (rr * rr))) / (g * rr)); +} + +inline double CulhamGeometry::g(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return g_array[ri]; + } + else + { + m = (g_array[ri + 1] - g_array[ri]) / dr; + c = g_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::Delta(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return Delta_array[ri]; + } + else + { + m = (Delta_array[ri + 1] - Delta_array[ri]) / dr; + c = Delta_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::Delta_prime(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return Delta_prime_array[ri]; + } + else + { + m = (Delta_prime_array[ri + 1] - Delta_prime_array[ri]) / dr; + c = Delta_prime_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::E(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return E_array[ri]; + } + else + { + m = (E_array[ri + 1] - E_array[ri]) / dr; + c = E_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::T(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return T_array[ri]; + } + else + { + m = (T_array[ri + 1] - T_array[ri]) / dr; + c = T_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::E_prime(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return E_prime_array[ri]; + } + else + { + m = (E_prime_array[ri + 1] - E_prime_array[ri]) / dr; + c = E_prime_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::T_prime(double rr) const +{ + int64_t ri; + double dr; + double m; + double c; + ri = (int64_t)(rr * 1000 / 1.0); + dr = 1.0 / 1000.0; + if (ri == 1000) + { + return T_prime_array[ri]; + } + else + { + m = (T_prime_array[ri + 1] - T_prime_array[ri]) / dr; + c = T_prime_array[ri] - m * ri * dr; + return m * rr + c; + } +} + +inline double CulhamGeometry::P(double rr) const +{ + if (rr == 0) + { + return 0.0; + } + else + { + return 0.005 * pow(rr, 3.0) + 0.1 * rr * Delta(rr) - 0.1 * pow(E(rr), 2.0) - pow(T(rr), 2.0) / rr; + } +} + +inline double CulhamGeometry::dP(double rr) const +{ + if (rr == 0) + { + return 0.0; + } + else + { + return 0.015 * (rr * rr) + 0.1 * rr * Delta_prime(rr) + 0.1 * Delta(rr) - 0.2 * E(rr) * E_prime(rr) - 2.0 * T(rr) * T_prime(rr) / rr + pow(T(rr), 2.0) / (rr * rr); + } +} diff --git a/include/InputFunctions/DomainGeometry/czarnyGeometry.h b/include/InputFunctions/DomainGeometry/czarnyGeometry.h new file mode 100644 index 00000000..62b9648d --- /dev/null +++ b/include/InputFunctions/DomainGeometry/czarnyGeometry.h @@ -0,0 +1,38 @@ +#pragma once + +#include + +#include "../domainGeometry.h" + +/* Triangular Shape and Ellipticity */ + +class CzarnyGeometry : public DomainGeometry +{ +public: + explicit CzarnyGeometry(); + explicit CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~CzarnyGeometry() = default; + + double Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double dFx_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFx_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; + +#include "czarnyGeometry.inl" diff --git a/include/InputFunctions/DomainGeometry/czarnyGeometry.inl b/include/InputFunctions/DomainGeometry/czarnyGeometry.inl new file mode 100644 index 00000000..35111528 --- /dev/null +++ b/include/InputFunctions/DomainGeometry/czarnyGeometry.inl @@ -0,0 +1,35 @@ +#pragma once + +#include "czarnyGeometry.h" + +// In earlier versions denoted by 'x' +inline double CzarnyGeometry::Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (1.0 - sqrt(1.0 + inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r/Rmax) * cos_theta))) / inverse_aspect_ratio_epsilon; +} + +// In earlier versions denoted by 'y' +inline double CzarnyGeometry::Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return ellipticity_e * factor_xi * (r/Rmax) * sin_theta / (1.0 + (1.0 - sqrt(1.0 + inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r/Rmax) * cos_theta)))); +} + +// In earlier versions denoted by 'Jrr' +inline double CzarnyGeometry::dFx_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return - (cos_theta) / (Rmax * sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r/Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0)); +} + +// In earlier versions denoted by 'Jtr' +inline double CzarnyGeometry::dFy_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + double temp = sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r/Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return (ellipticity_e * factor_xi * sin_theta) / (Rmax * (2.0 - temp)) + (ellipticity_e * factor_xi * inverse_aspect_ratio_epsilon * r * sin_theta * cos_theta) / (Rmax * Rmax * temp * (2.0 - temp) * (2.0 - temp)); +} + +// In earlier versions denoted by 'Jrt' +inline double CzarnyGeometry::dFx_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return ((r/Rmax) * sin_theta) / (sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r/Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0)); +} + +// In earlier versions denoted by 'Jtt' +inline double CzarnyGeometry::dFy_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + double temp = sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r/Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return (ellipticity_e * factor_xi * (r/Rmax) * cos_theta) / (2.0 - temp) - (ellipticity_e * factor_xi * inverse_aspect_ratio_epsilon * (r/Rmax) * (r/Rmax) * sin_theta * sin_theta) / (temp * (2.0 - temp) * (2.0 - temp)); +} diff --git a/include/InputFunctions/DomainGeometry/shafranovGeometry.h b/include/InputFunctions/DomainGeometry/shafranovGeometry.h new file mode 100644 index 00000000..259a6b70 --- /dev/null +++ b/include/InputFunctions/DomainGeometry/shafranovGeometry.h @@ -0,0 +1,34 @@ +#pragma once + +#include + +#include "../domainGeometry.h" + +/* Strechted Ellipse with a Shafranov Shift */ + +class ShafranovGeometry : public DomainGeometry +{ +public: + ShafranovGeometry() = default; + explicit ShafranovGeometry(const double& Rmax, const double& elongation_kappa, const double& shift_delta); + + virtual ~ShafranovGeometry() = default; + + double Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + double dFx_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFx_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + double dFy_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; + +#include "shafranovGeometry.inl" \ No newline at end of file diff --git a/include/InputFunctions/DomainGeometry/shafranovGeometry.inl b/include/InputFunctions/DomainGeometry/shafranovGeometry.inl new file mode 100644 index 00000000..970b18d2 --- /dev/null +++ b/include/InputFunctions/DomainGeometry/shafranovGeometry.inl @@ -0,0 +1,35 @@ +#pragma once + +#include "shafranovGeometry.h" + + +// In earlier versions denoted by 'x' +inline double ShafranovGeometry::Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (1.0 - elongation_kappa) * (r/Rmax) * cos_theta - shift_delta * (r/Rmax) * (r/Rmax); +} + +// In earlier versions denoted by 'y' +inline double ShafranovGeometry::Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (1.0 + elongation_kappa) * (r/Rmax) * sin_theta; +} + + +// In earlier versions denoted by 'Jrr' +inline double ShafranovGeometry::dFx_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return ( (Rmax - elongation_kappa * Rmax) * cos_theta - 2.0 * shift_delta * r ) / ( Rmax * Rmax ); +} + +// In earlier versions denoted by 'Jtr' +inline double ShafranovGeometry::dFy_dr(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return (elongation_kappa + 1.0) * sin_theta / Rmax; +} + +// In earlier versions denoted by 'Jrt' +inline double ShafranovGeometry::dFx_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return ((elongation_kappa - 1.0) * r * sin_theta) / Rmax; +} + +// In earlier versions denoted by 'Jtt' +inline double ShafranovGeometry::dFy_dt(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const { + return ((elongation_kappa + 1.0) * r * cos_theta) / Rmax; +} \ No newline at end of file diff --git a/include/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.h b/include/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.h new file mode 100644 index 00000000..0591eaf9 --- /dev/null +++ b/include/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class CartesianR2_CircularGeometry : public ExactSolution +{ +public: + CartesianR2_CircularGeometry() = default; + explicit CartesianR2_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_CircularGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.h b/include/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.h new file mode 100644 index 00000000..a5682958 --- /dev/null +++ b/include/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class CartesianR2_CzarnyGeometry : public ExactSolution +{ +public: + explicit CartesianR2_CzarnyGeometry(); + explicit CartesianR2_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~CartesianR2_CzarnyGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.h b/include/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.h new file mode 100644 index 00000000..ffcef9d6 --- /dev/null +++ b/include/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class CartesianR2_ShafranovGeometry : public ExactSolution +{ +public: + CartesianR2_ShafranovGeometry() = default; + explicit CartesianR2_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_ShafranovGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.h b/include/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.h new file mode 100644 index 00000000..79e062e1 --- /dev/null +++ b/include/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class CartesianR6_CircularGeometry : public ExactSolution +{ +public: + CartesianR6_CircularGeometry() = default; + explicit CartesianR6_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_CircularGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.h b/include/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.h new file mode 100644 index 00000000..7394b412 --- /dev/null +++ b/include/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class CartesianR6_CzarnyGeometry : public ExactSolution +{ +public: + explicit CartesianR6_CzarnyGeometry(); + explicit CartesianR6_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~CartesianR6_CzarnyGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.h b/include/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.h new file mode 100644 index 00000000..6146085e --- /dev/null +++ b/include/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class CartesianR6_ShafranovGeometry : public ExactSolution +{ +public: + CartesianR6_ShafranovGeometry() = default; + explicit CartesianR6_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_ShafranovGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/ExactSolution/polarR6_CircularGeometry.h b/include/InputFunctions/ExactSolution/polarR6_CircularGeometry.h new file mode 100644 index 00000000..c2fec1fd --- /dev/null +++ b/include/InputFunctions/ExactSolution/polarR6_CircularGeometry.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class PolarR6_CircularGeometry : public ExactSolution +{ +public: + PolarR6_CircularGeometry() = default; + explicit PolarR6_CircularGeometry(const double& Rmax); + virtual ~PolarR6_CircularGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/ExactSolution/polarR6_CulhamGeometry.h b/include/InputFunctions/ExactSolution/polarR6_CulhamGeometry.h new file mode 100644 index 00000000..81613b4e --- /dev/null +++ b/include/InputFunctions/ExactSolution/polarR6_CulhamGeometry.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class PolarR6_CulhamGeometry : public ExactSolution +{ +public: + PolarR6_CulhamGeometry() = default; + explicit PolarR6_CulhamGeometry(const double& Rmax); + virtual ~PolarR6_CulhamGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.h b/include/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.h new file mode 100644 index 00000000..1cfae341 --- /dev/null +++ b/include/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class PolarR6_CzarnyGeometry : public ExactSolution +{ +public: + explicit PolarR6_CzarnyGeometry(); + explicit PolarR6_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~PolarR6_CzarnyGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.h b/include/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.h new file mode 100644 index 00000000..5c0023e9 --- /dev/null +++ b/include/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class PolarR6_ShafranovGeometry : public ExactSolution +{ +public: + PolarR6_ShafranovGeometry() = default; + explicit PolarR6_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, const double& shift_delta); + virtual ~PolarR6_ShafranovGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/ExactSolution/refined_CircularGeometry.h b/include/InputFunctions/ExactSolution/refined_CircularGeometry.h new file mode 100644 index 00000000..d272c0ee --- /dev/null +++ b/include/InputFunctions/ExactSolution/refined_CircularGeometry.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class Refined_CircularGeometry : public ExactSolution +{ +public: + Refined_CircularGeometry() = default; + explicit Refined_CircularGeometry(const double& Rmax); + virtual ~Refined_CircularGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/ExactSolution/refined_CulhamGeometry.h b/include/InputFunctions/ExactSolution/refined_CulhamGeometry.h new file mode 100644 index 00000000..3290609c --- /dev/null +++ b/include/InputFunctions/ExactSolution/refined_CulhamGeometry.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class Refined_CulhamGeometry : public ExactSolution +{ +public: + Refined_CulhamGeometry() = default; + explicit Refined_CulhamGeometry(const double& Rmax); + virtual ~Refined_CulhamGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/ExactSolution/refined_CzarnyGeometry.h b/include/InputFunctions/ExactSolution/refined_CzarnyGeometry.h new file mode 100644 index 00000000..8e1ea02a --- /dev/null +++ b/include/InputFunctions/ExactSolution/refined_CzarnyGeometry.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class Refined_CzarnyGeometry : public ExactSolution +{ +public: + explicit Refined_CzarnyGeometry(); + explicit Refined_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + + virtual ~Refined_CzarnyGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/ExactSolution/refined_ShafranovGeometry.h b/include/InputFunctions/ExactSolution/refined_ShafranovGeometry.h new file mode 100644 index 00000000..11b06a1f --- /dev/null +++ b/include/InputFunctions/ExactSolution/refined_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../exactSolution.h" + +class Refined_ShafranovGeometry : public ExactSolution +{ +public: + Refined_ShafranovGeometry() = default; + explicit Refined_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, const double& shift_delta); + virtual ~Refined_ShafranovGeometry() = default; + + double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h new file mode 100644 index 00000000..fdab1019 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Poisson_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_Poisson_CircularGeometry() = default; + explicit CartesianR2_Poisson_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_Poisson_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h new file mode 100644 index 00000000..a00e9cde --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Poisson_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_Poisson_CzarnyGeometry() = default; + explicit CartesianR2_Poisson_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_Poisson_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h new file mode 100644 index 00000000..9e0278ec --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Poisson_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_Poisson_ShafranovGeometry() = default; + explicit CartesianR2_Poisson_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_Poisson_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h new file mode 100644 index 00000000..bfed2923 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_SonnendruckerGyro_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_SonnendruckerGyro_CircularGeometry() = default; + explicit CartesianR2_SonnendruckerGyro_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_SonnendruckerGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h new file mode 100644 index 00000000..e558bbcf --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_SonnendruckerGyro_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_SonnendruckerGyro_CzarnyGeometry() = default; + explicit CartesianR2_SonnendruckerGyro_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_SonnendruckerGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h new file mode 100644 index 00000000..bb63e7b9 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_SonnendruckerGyro_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_SonnendruckerGyro_ShafranovGeometry() = default; + explicit CartesianR2_SonnendruckerGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_SonnendruckerGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h new file mode 100644 index 00000000..63ddb244 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Sonnendrucker_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_Sonnendrucker_CircularGeometry() = default; + explicit CartesianR2_Sonnendrucker_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_Sonnendrucker_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h new file mode 100644 index 00000000..b301b409 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Sonnendrucker_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_Sonnendrucker_CzarnyGeometry() = default; + explicit CartesianR2_Sonnendrucker_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_Sonnendrucker_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h new file mode 100644 index 00000000..ec632ee3 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Sonnendrucker_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_Sonnendrucker_ShafranovGeometry() = default; + explicit CartesianR2_Sonnendrucker_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_Sonnendrucker_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h new file mode 100644 index 00000000..c114074d --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniGyro_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniGyro_CircularGeometry() = default; + explicit CartesianR2_ZoniGyro_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_ZoniGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h new file mode 100644 index 00000000..246d7c22 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniGyro_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniGyro_CzarnyGeometry() = default; + explicit CartesianR2_ZoniGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_ZoniGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h new file mode 100644 index 00000000..d2173f0f --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniGyro_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniGyro_ShafranovGeometry() = default; + explicit CartesianR2_ZoniGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_ZoniGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h new file mode 100644 index 00000000..bdd6e334 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniShiftedGyro_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniShiftedGyro_CircularGeometry() = default; + explicit CartesianR2_ZoniShiftedGyro_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_ZoniShiftedGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h new file mode 100644 index 00000000..71a94d23 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniShiftedGyro_CzarnyGeometry() = default; + explicit CartesianR2_ZoniShiftedGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_ZoniShiftedGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h new file mode 100644 index 00000000..c408e902 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniShiftedGyro_ShafranovGeometry() = default; + explicit CartesianR2_ZoniShiftedGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_ZoniShiftedGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h new file mode 100644 index 00000000..63ff4a5e --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniShifted_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniShifted_CircularGeometry() = default; + explicit CartesianR2_ZoniShifted_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_ZoniShifted_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h new file mode 100644 index 00000000..e9c87bfd --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniShifted_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniShifted_CzarnyGeometry() = default; + explicit CartesianR2_ZoniShifted_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_ZoniShifted_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h new file mode 100644 index 00000000..2bfb19e6 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_ZoniShifted_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_ZoniShifted_ShafranovGeometry() = default; + explicit CartesianR2_ZoniShifted_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_ZoniShifted_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h new file mode 100644 index 00000000..329a8bc9 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Zoni_CircularGeometry : public SourceTerm +{ +public: + CartesianR2_Zoni_CircularGeometry() = default; + explicit CartesianR2_Zoni_CircularGeometry(const double& Rmax); + virtual ~CartesianR2_Zoni_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h new file mode 100644 index 00000000..3e7b6d9e --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Zoni_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR2_Zoni_CzarnyGeometry() = default; + explicit CartesianR2_Zoni_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR2_Zoni_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h new file mode 100644 index 00000000..c85978a4 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR2_Zoni_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR2_Zoni_ShafranovGeometry() = default; + explicit CartesianR2_Zoni_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR2_Zoni_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h new file mode 100644 index 00000000..d770b623 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Poisson_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_Poisson_CircularGeometry() = default; + explicit CartesianR6_Poisson_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_Poisson_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h new file mode 100644 index 00000000..292ed81b --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Poisson_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_Poisson_CzarnyGeometry() = default; + explicit CartesianR6_Poisson_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_Poisson_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h new file mode 100644 index 00000000..36443c1b --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Poisson_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_Poisson_ShafranovGeometry() = default; + explicit CartesianR6_Poisson_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_Poisson_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h new file mode 100644 index 00000000..4c4256e7 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_SonnendruckerGyro_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_SonnendruckerGyro_CircularGeometry() = default; + explicit CartesianR6_SonnendruckerGyro_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_SonnendruckerGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h new file mode 100644 index 00000000..02426d9e --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_SonnendruckerGyro_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_SonnendruckerGyro_CzarnyGeometry() = default; + explicit CartesianR6_SonnendruckerGyro_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_SonnendruckerGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h new file mode 100644 index 00000000..f2f90dea --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_SonnendruckerGyro_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_SonnendruckerGyro_ShafranovGeometry() = default; + explicit CartesianR6_SonnendruckerGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_SonnendruckerGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h new file mode 100644 index 00000000..cf0b7dd0 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Sonnendrucker_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_Sonnendrucker_CircularGeometry() = default; + explicit CartesianR6_Sonnendrucker_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_Sonnendrucker_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h new file mode 100644 index 00000000..b406000f --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Sonnendrucker_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_Sonnendrucker_CzarnyGeometry() = default; + explicit CartesianR6_Sonnendrucker_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_Sonnendrucker_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h new file mode 100644 index 00000000..06b5edcc --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Sonnendrucker_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_Sonnendrucker_ShafranovGeometry() = default; + explicit CartesianR6_Sonnendrucker_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_Sonnendrucker_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h new file mode 100644 index 00000000..55a5cf8a --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniGyro_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniGyro_CircularGeometry() = default; + explicit CartesianR6_ZoniGyro_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_ZoniGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h new file mode 100644 index 00000000..0febb25b --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniGyro_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniGyro_CzarnyGeometry() = default; + explicit CartesianR6_ZoniGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_ZoniGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h new file mode 100644 index 00000000..fa0b0775 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniGyro_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniGyro_ShafranovGeometry() = default; + explicit CartesianR6_ZoniGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_ZoniGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h new file mode 100644 index 00000000..3aa7e555 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniShiftedGyro_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniShiftedGyro_CircularGeometry() = default; + explicit CartesianR6_ZoniShiftedGyro_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_ZoniShiftedGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h new file mode 100644 index 00000000..b298cf7f --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniShiftedGyro_CzarnyGeometry() = default; + explicit CartesianR6_ZoniShiftedGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_ZoniShiftedGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h new file mode 100644 index 00000000..7497be86 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniShiftedGyro_ShafranovGeometry() = default; + explicit CartesianR6_ZoniShiftedGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_ZoniShiftedGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h new file mode 100644 index 00000000..e772c849 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniShifted_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniShifted_CircularGeometry() = default; + explicit CartesianR6_ZoniShifted_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_ZoniShifted_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h new file mode 100644 index 00000000..ad40cc10 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniShifted_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniShifted_CzarnyGeometry() = default; + explicit CartesianR6_ZoniShifted_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_ZoniShifted_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h new file mode 100644 index 00000000..bf58c6fa --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_ZoniShifted_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_ZoniShifted_ShafranovGeometry() = default; + explicit CartesianR6_ZoniShifted_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_ZoniShifted_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h new file mode 100644 index 00000000..22e1d1e7 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Zoni_CircularGeometry : public SourceTerm +{ +public: + CartesianR6_Zoni_CircularGeometry() = default; + explicit CartesianR6_Zoni_CircularGeometry(const double& Rmax); + virtual ~CartesianR6_Zoni_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h new file mode 100644 index 00000000..4e6c7aa8 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Zoni_CzarnyGeometry : public SourceTerm +{ +public: + CartesianR6_Zoni_CzarnyGeometry() = default; + explicit CartesianR6_Zoni_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~CartesianR6_Zoni_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h new file mode 100644 index 00000000..8be80c51 --- /dev/null +++ b/include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class CartesianR6_Zoni_ShafranovGeometry : public SourceTerm +{ +public: + CartesianR6_Zoni_ShafranovGeometry() = default; + explicit CartesianR6_Zoni_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~CartesianR6_Zoni_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h new file mode 100644 index 00000000..244cdc66 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Poisson_CircularGeometry : public SourceTerm +{ +public: + PolarR6_Poisson_CircularGeometry() = default; + explicit PolarR6_Poisson_CircularGeometry(const double& Rmax); + virtual ~PolarR6_Poisson_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h new file mode 100644 index 00000000..02caa895 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Poisson_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_Poisson_CzarnyGeometry() = default; + explicit PolarR6_Poisson_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_Poisson_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h new file mode 100644 index 00000000..cd9c1c19 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Poisson_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_Poisson_ShafranovGeometry() = default; + explicit PolarR6_Poisson_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_Poisson_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h new file mode 100644 index 00000000..f7995bb6 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_SonnendruckerGyro_CircularGeometry : public SourceTerm +{ +public: + PolarR6_SonnendruckerGyro_CircularGeometry() = default; + explicit PolarR6_SonnendruckerGyro_CircularGeometry(const double& Rmax); + virtual ~PolarR6_SonnendruckerGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h new file mode 100644 index 00000000..3c81fb8e --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_SonnendruckerGyro_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_SonnendruckerGyro_CzarnyGeometry() = default; + explicit PolarR6_SonnendruckerGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_SonnendruckerGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h new file mode 100644 index 00000000..860abedd --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_SonnendruckerGyro_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_SonnendruckerGyro_ShafranovGeometry() = default; + explicit PolarR6_SonnendruckerGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_SonnendruckerGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h new file mode 100644 index 00000000..7901457f --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Sonnendrucker_CircularGeometry : public SourceTerm +{ +public: + PolarR6_Sonnendrucker_CircularGeometry() = default; + explicit PolarR6_Sonnendrucker_CircularGeometry(const double& Rmax); + virtual ~PolarR6_Sonnendrucker_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h new file mode 100644 index 00000000..5906258d --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Sonnendrucker_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_Sonnendrucker_CzarnyGeometry() = default; + explicit PolarR6_Sonnendrucker_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_Sonnendrucker_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h new file mode 100644 index 00000000..190acff2 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Sonnendrucker_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_Sonnendrucker_ShafranovGeometry() = default; + explicit PolarR6_Sonnendrucker_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_Sonnendrucker_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h new file mode 100644 index 00000000..c968fd8b --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniGyro_CircularGeometry : public SourceTerm +{ +public: + PolarR6_ZoniGyro_CircularGeometry() = default; + explicit PolarR6_ZoniGyro_CircularGeometry(const double& Rmax); + virtual ~PolarR6_ZoniGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h new file mode 100644 index 00000000..787f5bad --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniGyro_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_ZoniGyro_CzarnyGeometry() = default; + explicit PolarR6_ZoniGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_ZoniGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h new file mode 100644 index 00000000..26215148 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniGyro_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_ZoniGyro_ShafranovGeometry() = default; + explicit PolarR6_ZoniGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_ZoniGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h new file mode 100644 index 00000000..fb6dd921 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShiftedGyro_CircularGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShiftedGyro_CircularGeometry() = default; + explicit PolarR6_ZoniShiftedGyro_CircularGeometry(const double& Rmax); + virtual ~PolarR6_ZoniShiftedGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h new file mode 100644 index 00000000..8015023e --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShiftedGyro_CulhamGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShiftedGyro_CulhamGeometry() = default; + explicit PolarR6_ZoniShiftedGyro_CulhamGeometry(const double& Rmax); + virtual ~PolarR6_ZoniShiftedGyro_CulhamGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h new file mode 100644 index 00000000..ed50f60c --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShiftedGyro_CzarnyGeometry() = default; + explicit PolarR6_ZoniShiftedGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_ZoniShiftedGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h new file mode 100644 index 00000000..fdf3521c --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShiftedGyro_ShafranovGeometry() = default; + explicit PolarR6_ZoniShiftedGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_ZoniShiftedGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h new file mode 100644 index 00000000..0130f650 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShifted_CircularGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShifted_CircularGeometry() = default; + explicit PolarR6_ZoniShifted_CircularGeometry(const double& Rmax); + virtual ~PolarR6_ZoniShifted_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h new file mode 100644 index 00000000..703aabd3 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShifted_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShifted_CzarnyGeometry() = default; + explicit PolarR6_ZoniShifted_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_ZoniShifted_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h new file mode 100644 index 00000000..3c4d9d68 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_ZoniShifted_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_ZoniShifted_ShafranovGeometry() = default; + explicit PolarR6_ZoniShifted_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_ZoniShifted_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h new file mode 100644 index 00000000..a275fd7a --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Zoni_CircularGeometry : public SourceTerm +{ +public: + PolarR6_Zoni_CircularGeometry() = default; + explicit PolarR6_Zoni_CircularGeometry(const double& Rmax); + virtual ~PolarR6_Zoni_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h new file mode 100644 index 00000000..9164dc20 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Zoni_CzarnyGeometry : public SourceTerm +{ +public: + PolarR6_Zoni_CzarnyGeometry() = default; + explicit PolarR6_Zoni_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~PolarR6_Zoni_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h new file mode 100644 index 00000000..ec537c15 --- /dev/null +++ b/include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class PolarR6_Zoni_ShafranovGeometry : public SourceTerm +{ +public: + PolarR6_Zoni_ShafranovGeometry() = default; + explicit PolarR6_Zoni_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~PolarR6_Zoni_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h new file mode 100644 index 00000000..316ec4a1 --- /dev/null +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class Refined_ZoniShiftedGyro_CircularGeometry : public SourceTerm +{ +public: + Refined_ZoniShiftedGyro_CircularGeometry() = default; + explicit Refined_ZoniShiftedGyro_CircularGeometry(const double& Rmax); + virtual ~Refined_ZoniShiftedGyro_CircularGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h new file mode 100644 index 00000000..aff98ba7 --- /dev/null +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class Refined_ZoniShiftedGyro_CulhamGeometry : public SourceTerm +{ +public: + Refined_ZoniShiftedGyro_CulhamGeometry() = default; + explicit Refined_ZoniShiftedGyro_CulhamGeometry(const double& Rmax); + virtual ~Refined_ZoniShiftedGyro_CulhamGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; +}; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h new file mode 100644 index 00000000..eb05b679 --- /dev/null +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class Refined_ZoniShiftedGyro_CzarnyGeometry : public SourceTerm +{ +public: + Refined_ZoniShiftedGyro_CzarnyGeometry() = default; + explicit Refined_ZoniShiftedGyro_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e); + virtual ~Refined_ZoniShiftedGyro_CzarnyGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + + void initializeGeometry(); + double factor_xi; +}; diff --git a/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h new file mode 100644 index 00000000..95f20624 --- /dev/null +++ b/include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include "../sourceTerm.h" + +class Refined_ZoniShiftedGyro_ShafranovGeometry : public SourceTerm +{ +public: + Refined_ZoniShiftedGyro_ShafranovGeometry() = default; + explicit Refined_ZoniShiftedGyro_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta); + virtual ~Refined_ZoniShiftedGyro_ShafranovGeometry() = default; + + double rhs_f(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const override; + +private: + const double Rmax = 1.3; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; +}; diff --git a/include/InputFunctions/boundaryConditions.h b/include/InputFunctions/boundaryConditions.h new file mode 100644 index 00000000..fe1e966d --- /dev/null +++ b/include/InputFunctions/boundaryConditions.h @@ -0,0 +1,14 @@ +#pragma once + +class BoundaryConditions +{ +public: + BoundaryConditions() = default; + virtual ~BoundaryConditions() = default; + + virtual double u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; + // Only used if DirBC_Interior = true + virtual double u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; +}; \ No newline at end of file diff --git a/include/InputFunctions/densityProfileCoefficients.h b/include/InputFunctions/densityProfileCoefficients.h new file mode 100644 index 00000000..9cb58236 --- /dev/null +++ b/include/InputFunctions/densityProfileCoefficients.h @@ -0,0 +1,14 @@ +#pragma once + +class DensityProfileCoefficients +{ +public: + DensityProfileCoefficients() = default; + virtual ~DensityProfileCoefficients() = default; + + virtual double alpha(const double& r) const = 0; + virtual double beta(const double& r) const = 0; + + // Only used in custom mesh generation -> refinement_radius + virtual double getAlphaJump() const = 0; +}; \ No newline at end of file diff --git a/include/InputFunctions/domainGeometry.h b/include/InputFunctions/domainGeometry.h new file mode 100644 index 00000000..bfb1ce76 --- /dev/null +++ b/include/InputFunctions/domainGeometry.h @@ -0,0 +1,35 @@ +#pragma once + +/** + * @class DomainGeometry + * @brief An abstract base class representing the geometric properties of a domain. + * + * This class provides an interface for calculating geometric transformations and their derivatives + * for a domain in polar coordinates (r, θ). It includes pure virtual functions to compute the + * Cartesian coordinates (Fx, Fy) from polar coordinates, as well as their partial derivatives with + * respect to r and θ. + * + * Subclasses should implement the specific transformations and derivative calculations for their + * respective geometric domains. + */ + +class DomainGeometry +{ +public: + DomainGeometry() = default; + virtual ~DomainGeometry() = default; + + // In earlier versions denoted by 'x' and 'y'. + virtual double Fx(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const = 0; + virtual double Fy(const double& r, const double& theta, const double& sin_theta, const double& cos_theta) const = 0; + + // In earlier versions denoted by 'Jrr', 'Jtr', 'Jrt' and 'Jtt'. + virtual double dFx_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; + virtual double dFy_dr(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; + virtual double dFx_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; + virtual double dFy_dt(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; +}; diff --git a/include/InputFunctions/exactSolution.h b/include/InputFunctions/exactSolution.h new file mode 100644 index 00000000..afc3ecd1 --- /dev/null +++ b/include/InputFunctions/exactSolution.h @@ -0,0 +1,11 @@ +#pragma once + +class ExactSolution +{ +public: + ExactSolution() = default; + virtual ~ExactSolution() = default; + + virtual double exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; +}; \ No newline at end of file diff --git a/include/InputFunctions/sourceTerm.h b/include/InputFunctions/sourceTerm.h new file mode 100644 index 00000000..9cc9dc63 --- /dev/null +++ b/include/InputFunctions/sourceTerm.h @@ -0,0 +1,11 @@ +#pragma once + +class SourceTerm +{ +public: + SourceTerm() = default; + virtual ~SourceTerm() = default; + + virtual double rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const = 0; +}; \ No newline at end of file diff --git a/include/Interpolation/interpolation.h b/include/Interpolation/interpolation.h new file mode 100644 index 00000000..e93fde0f --- /dev/null +++ b/include/Interpolation/interpolation.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include + +#include + +#include "../PolarGrid/polargrid.h" +#include "../Level/level.h" + +#include "../LinearAlgebra/vector.h" +#include "../LinearAlgebra/vector_operations.h" + +#include "../common/global_definitions.h" + +class Interpolation +{ +public: + explicit Interpolation(const std::vector& threads_per_level, const bool DirBC_Interior); + + /* Remark: This injection is not scaled. */ + void applyInjection(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + + /* Bilinear interpolation operator */ + void applyProlongation0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + void applyProlongation(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + void applyExtrapolatedProlongation0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + void applyExtrapolatedProlongation(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + + /* Scaled full weighting (FW) restriction operator. */ + void applyRestriction0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + void applyRestriction(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + void applyExtrapolatedRestriction0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + void applyExtrapolatedRestriction(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + + /* Bicubic FMG interpolator 1/16 * [-1, 9, 9, -1] */ + void applyFMGInterpolation(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const; + +private: + const std::vector& threads_per_level_; + const bool DirBC_Interior_; +}; \ No newline at end of file diff --git a/include/Level/level.h b/include/Level/level.h new file mode 100644 index 00000000..de4d74a1 --- /dev/null +++ b/include/Level/level.h @@ -0,0 +1,183 @@ +#pragma once + +// Required to prevent circular dependencies. +class DirectSolver; +class Residual; +class Smoother; +class ExtrapolatedSmoother; + +#include +#include +#include + +#include "../PolarGrid/polargrid.h" + +#include "../InputFunctions/boundaryConditions.h" +#include "../InputFunctions/densityProfileCoefficients.h" +#include "../InputFunctions/domainGeometry.h" +#include "../InputFunctions/sourceTerm.h" + +#include "../DirectSolver/directSolver.h" +#include "../ExtrapolatedSmoother/extrapolatedSmoother.h" +#include "../Residual/residual.h" +#include "../Smoother/smoother.h" + +#include "../common/geometry_helper.h" + +// The `Level` class represents a single level of a multigrid method. +// In multigrid solvers, the computational domain is divided into different levels, where each level corresponds to a grid with a different resolution. +// The `Level` class manages the specific data structures and operations needed to solve a problem at a given level, including residual computation, direct solving, and smoothing. +// It holds information for the solution, residuals, right-hand side, and error corrections used in the multigrid method. + +// The `LevelCache` class is responsible for caching auxiliary data required for solving a problem at a specific level of a multigrid method. +// It stores essential data such as trigonometric values (e.g., `sin_theta` and `cos_theta`) and profile coefficients (e.g., `alpha`, `beta`) +// that are frequently used in the solution process. Additionally, depending on the stencil distribution strategy, it can store transformation +// coefficients (`arr`, `att`, `art`) related to the domain geometry. These coefficients are critical for efficient matrix-free stencil operations +// and contribute to the accuracy and performance of the multigrid solver. + +class LevelCache; + +class Level +{ +public: + // ----------- // + // Constructor // + explicit Level(const int level_depth, std::unique_ptr grid, + std::unique_ptr level_cache, const ExtrapolationType extrapolation, + const bool FMG); + + // ---------------- // + // Getter Functions // + int level_depth() const; + const PolarGrid& grid() const; + const LevelCache& levelCache() const; + + Vector& rhs(); + const Vector& rhs() const; + Vector& solution(); + const Vector& solution() const; + Vector& residual(); + const Vector& residual() const; + Vector& error_correction(); + const Vector& error_correction() const; + + // -------------- // + // Apply Residual // + void initializeResidual(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, const bool DirBC_Interior, + const int num_omp_threads, const StencilDistributionMethod stencil_distribution_method); + void computeResidual(Vector& result, const Vector& rhs, const Vector& x) const; + + // ------------------- // + // Solve coarse System // + void initializeDirectSolver(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads, + const StencilDistributionMethod stencil_distribution_method); + // Note: The rhs (right-hand side) vector gets overwritten by the solution. + void directSolveInPlace(Vector& x) const; + + // --------------- // + // Apply Smoothing // + void initializeSmoothing(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, const bool DirBC_Interior, + const int num_omp_threads, const StencilDistributionMethod stencil_distribution_method); + void smoothing(Vector& x, const Vector& rhs, Vector& temp) const; + + // ---------------------------- // + // Apply Extrapolated Smoothing // + void initializeExtrapolatedSmoothing(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads, + const StencilDistributionMethod stencil_distribution_method); + void extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) const; + +private: + const int level_depth_; + std::unique_ptr grid_; + std::unique_ptr level_cache_; + + std::unique_ptr op_directSolver_; + std::unique_ptr op_residual_; + std::unique_ptr op_smoother_; + std::unique_ptr op_extrapolated_smoother_; + + Vector rhs_; + Vector solution_; + Vector residual_; + Vector error_correction_; +}; + +class LevelCache +{ +public: + explicit LevelCache(const PolarGrid& grid, const DensityProfileCoefficients& density_profile_coefficients, + const DomainGeometry& domain_geometry, const bool cache_density_profile_coefficients, + const bool cache_domain_geometry); + explicit LevelCache(const Level& previous_level, const PolarGrid& current_grid); + + const DensityProfileCoefficients& densityProfileCoefficients() const; + const DomainGeometry& domainGeometry() const; + + const std::vector& sin_theta() const; + const std::vector& cos_theta() const; + + bool cacheDensityProfileCoefficients() const; + const std::vector& coeff_alpha() const; + const std::vector& coeff_beta() const; + + bool cacheDomainGeometry() const; + const Vector& arr() const; + const Vector& att() const; + const Vector& art() const; + const Vector& detDF() const; + + inline void obtainValues(const int i_r, const int i_theta, const int global_index, const double& r, + const double& theta, double& sin_theta, double& cos_theta, double& coeff_beta, double& arr, + double& att, double& art, double& detDF) const + { + sin_theta = sin_theta_[i_theta]; + cos_theta = cos_theta_[i_theta]; + + if (cache_density_profile_coefficients_) + coeff_beta = coeff_beta_[i_r]; + else + coeff_beta = density_profile_coefficients_.beta(r); + + double coeff_alpha; + if (!cache_domain_geometry_) { + if (cache_density_profile_coefficients_) + coeff_alpha = coeff_alpha_[i_r]; + else + coeff_alpha = density_profile_coefficients_.alpha(r); + } + + if (cache_domain_geometry_) { + arr = arr_[global_index]; + att = att_[global_index]; + art = art_[global_index]; + detDF = detDF_[global_index]; + } + else { + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + } + } + +private: + const DomainGeometry& domain_geometry_; + const DensityProfileCoefficients& density_profile_coefficients_; + + std::vector sin_theta_; + std::vector cos_theta_; + + bool cache_density_profile_coefficients_; // cache alpha(r_i), beta(r_i) + std::vector coeff_alpha_; + std::vector coeff_beta_; + + bool cache_domain_geometry_; // cache arr, att, art, detDF + Vector arr_; + Vector att_; + Vector art_; + Vector detDF_; +}; diff --git a/include/LinearAlgebra/coo_matrix.h b/include/LinearAlgebra/coo_matrix.h new file mode 100644 index 00000000..41eb2f30 --- /dev/null +++ b/include/LinearAlgebra/coo_matrix.h @@ -0,0 +1,341 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +template +class SparseMatrixCOO +{ +public: + using triplet_type = std::tuple; + + SparseMatrixCOO(); + SparseMatrixCOO(const SparseMatrixCOO& other); + SparseMatrixCOO(SparseMatrixCOO&& other) noexcept; + + explicit SparseMatrixCOO(int rows, int columns, int nnz); + explicit SparseMatrixCOO(int rows, int columns, const std::vector& entries); + + SparseMatrixCOO& operator=(const SparseMatrixCOO& other); + SparseMatrixCOO& operator=(SparseMatrixCOO&& other) noexcept; + + int rows() const; + int columns() const; + int non_zero_size() const; + + const int& row_index(int nz_index) const; + int& row_index(int nz_index); + + const int& col_index(int nz_index) const; + int& col_index(int nz_index); + + const T& value(int nz_index) const; + T& value(int nz_index); + + bool is_symmetric() const; + void is_symmetric(bool value); + + int* row_indices_data() const; + int* column_indices_data() const; + T* values_data() const; + + template + friend std::ostream& operator<<(std::ostream& stream, const SparseMatrixCOO& matrix); + + void write_to_file(const std::string& filename) const; + +private: + int rows_; + int columns_; + int nnz_; + std::unique_ptr row_indices_; + std::unique_ptr column_indices_; + std::unique_ptr values_; + bool is_symmetric_ = false; +}; + +template +std::ostream& operator<<(std::ostream& stream, const SparseMatrixCOO& matrix) +{ + stream << "SparseMatrixCOO: " << matrix.rows_ << " x " << matrix.columns_ << "\n"; + stream << "Number of non-zeros (nnz): " << matrix.nnz_ << "\n"; + if (matrix.is_symmetric_) { + stream << "Matrix is symmetric.\n"; + } + stream << "Non-zero elements (row, column, value):\n"; + for (int i = 0; i < matrix.nnz_; ++i) { + stream << "(" << matrix.row_indices_[i] << ", " << matrix.column_indices_[i] << ", " << matrix.values_[i] + << ")\n"; + } + return stream; +} + +template +void SparseMatrixCOO::write_to_file(const std::string& filename) const +{ + std::ofstream file(filename); + if (!file.is_open()) { + throw std::runtime_error("Unable to open file"); + } + file << "SparseMatrixCOO: " << rows_ << " x " << columns_ << "\n"; + file << "Number of non-zeros (nnz): " << nnz_ << "\n"; + if (is_symmetric_) { + file << "Matrix is symmetric.\n"; + } + file << "Non-zero elements (row, column, value):\n"; + for (int i = 0; i < nnz_; ++i) { + file << "(" << row_indices_[i] << ", " << column_indices_[i] << ", " << values_[i] << ")\n"; + } + file.close(); +} + +template +void sort_entries(std::vector>& entries) +{ + const auto compare = [](const auto entry1, const auto entry2) { + const auto local_r1 = std::get<0>(entry1); + const auto local_r2 = std::get<0>(entry2); + if (local_r1 < local_r2) { + return true; + } + else if (local_r1 == local_r2) { + return std::get<1>(entry1) < std::get<1>(entry2); + } + return false; + }; + std::sort(entries.begin(), entries.end(), compare); +} + +// default construction +template +SparseMatrixCOO::SparseMatrixCOO() + : rows_(0) + , columns_(0) + , nnz_(0) + , row_indices_(nullptr) + , column_indices_(nullptr) + , values_(nullptr) + , is_symmetric_(false) +{ +} + +// copy construction +template +SparseMatrixCOO::SparseMatrixCOO(const SparseMatrixCOO& other) + : rows_(other.rows_) + , columns_(other.columns_) + , nnz_(other.nnz_) + , row_indices_(std::make_unique(nnz_)) + , column_indices_(std::make_unique(nnz_)) + , values_(std::make_unique(nnz_)) + , is_symmetric_(other.is_symmetric_) +{ + std::copy(other.row_indices_.get(), other.row_indices_.get() + nnz_, row_indices_.get()); + std::copy(other.column_indices_.get(), other.column_indices_.get() + nnz_, column_indices_.get()); + std::copy(other.values_.get(), other.values_.get() + nnz_, values_.get()); +} + +// copy assignment +template +SparseMatrixCOO& SparseMatrixCOO::operator=(const SparseMatrixCOO& other) +{ + if (this == &other) { + // Self-assignment, no work needed + return *this; + } + // Only allocate new memory if the sizes are different + if (nnz_ != other.nnz_) { + row_indices_ = std::make_unique(other.nnz_); + column_indices_ = std::make_unique(other.nnz_); + values_ = std::make_unique(other.nnz_); + } + // Copy the elements + rows_ = other.rows_; + columns_ = other.columns_; + nnz_ = other.nnz_; + is_symmetric_ = other.is_symmetric_; + std::copy(other.row_indices_.get(), other.row_indices_.get() + nnz_, row_indices_.get()); + std::copy(other.column_indices_.get(), other.column_indices_.get() + nnz_, column_indices_.get()); + std::copy(other.values_.get(), other.values_.get() + nnz_, values_.get()); + return *this; +} + +// move construction +template +SparseMatrixCOO::SparseMatrixCOO(SparseMatrixCOO&& other) noexcept + : rows_(other.rows_) + , columns_(other.columns_) + , nnz_(other.nnz_) + , row_indices_(std::move(other.row_indices_)) + , column_indices_(std::move(other.column_indices_)) + , values_(std::move(other.values_)) + , is_symmetric_(other.is_symmetric_) +{ + other.nnz_ = 0; + other.rows_ = 0; + other.columns_ = 0; + other.is_symmetric_ = false; +} + +// move assignment +template +SparseMatrixCOO& SparseMatrixCOO::operator=(SparseMatrixCOO&& other) noexcept +{ + rows_ = other.rows_; + columns_ = other.columns_; + nnz_ = other.nnz_; + row_indices_ = std::move(other.row_indices_); + column_indices_ = std::move(other.column_indices_); + values_ = std::move(other.values_); + is_symmetric_ = other.is_symmetric_; + other.nnz_ = 0; + other.rows_ = 0; + other.columns_ = 0; + other.is_symmetric_ = false; + return *this; +} + +template +SparseMatrixCOO::SparseMatrixCOO(int rows, int columns, int nnz) + : rows_(rows) + , columns_(columns) + , nnz_(nnz) + , row_indices_(std::make_unique(nnz)) + , column_indices_(std::make_unique(nnz)) + , values_(std::make_unique(nnz)) + , is_symmetric_(false) +{ + assert(rows >= 0); + assert(columns >= 0); + assert(nnz >= 0); +} + +template +SparseMatrixCOO::SparseMatrixCOO(int rows, int columns, const std::vector& entries) + : // entries: row_idx, col_idx, value + rows_(rows) + , columns_(columns) + , nnz_(entries.size()) + , row_indices_(std::make_unique(nnz_)) + , column_indices_(std::make_unique(nnz_)) + , values_(std::make_unique(nnz_)) + , is_symmetric_(false) +{ + assert(rows_ >= 0); + assert(columns_ >= 0); + assert(nnz_ >= 0); +#pragma omp parallel for + for (int i = 0; i < nnz_; i++) { + assert(0 <= std::get<0>(entries[i]) && std::get<0>(entries[i]) < rows_); + assert(0 <= std::get<1>(entries[i]) && std::get<1>(entries[i]) < columns_); + row_indices_[i] = std::get<0>(entries[i]); + column_indices_[i] = std::get<1>(entries[i]); + values_[i] = std::get<2>(entries[i]); + } +} + +template +int SparseMatrixCOO::rows() const +{ + assert(this->rows_ >= 0); + return this->rows_; +} +template +int SparseMatrixCOO::columns() const +{ + assert(this->columns_ >= 0); + return this->columns_; +} +template +int SparseMatrixCOO::non_zero_size() const +{ + assert(this->nnz_ >= 0); + assert(static_cast(this->nnz_) <= static_cast(this->rows_) * static_cast(this->columns_)); + return this->nnz_; +} + +template +int& SparseMatrixCOO::row_index(int nz_index) +{ + assert(nz_index >= 0); + assert(nz_index < this->nnz_); + return this->row_indices_[nz_index]; +} +template +const int& SparseMatrixCOO::row_index(int nz_index) const +{ + assert(nz_index >= 0); + assert(nz_index < this->nnz_); + return this->row_indices_[nz_index]; +} + +template +int& SparseMatrixCOO::col_index(int nz_index) +{ + assert(nz_index >= 0); + assert(nz_index < this->nnz_); + return this->column_indices_[nz_index]; +} +template +const int& SparseMatrixCOO::col_index(int nz_index) const +{ + assert(nz_index >= 0); + assert(nz_index < this->nnz_); + return this->column_indices_[nz_index]; +} + +template +T& SparseMatrixCOO::value(int nz_index) +{ + assert(nz_index >= 0); + assert(nz_index < this->nnz_); + return this->values_[nz_index]; +} +template +const T& SparseMatrixCOO::value(int nz_index) const +{ + assert(nz_index >= 0); + assert(nz_index < this->nnz_); + return this->values_[nz_index]; +} + +template +bool SparseMatrixCOO::is_symmetric() const +{ + return is_symmetric_; +} +template +void SparseMatrixCOO::is_symmetric(bool value) +{ + is_symmetric_ = value; +} + +template +int* SparseMatrixCOO::row_indices_data() const +{ + return row_indices_.get(); +} + +template +int* SparseMatrixCOO::column_indices_data() const +{ + return column_indices_.get(); +} + +template +T* SparseMatrixCOO::values_data() const +{ + return values_.get(); +} \ No newline at end of file diff --git a/include/LinearAlgebra/csr_matrix.h b/include/LinearAlgebra/csr_matrix.h new file mode 100644 index 00000000..49f6e361 --- /dev/null +++ b/include/LinearAlgebra/csr_matrix.h @@ -0,0 +1,313 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* The CSR matrix format is currently unused, as we use MUMPS which relies on the COO format. */ +/* Here we provide a custom LU decomposition solver, which could be replaced by different library implementation, +if we would decide to move away from mumps. */ + +template +class SparseMatrixCSR +{ +public: + using triplet_type = std::tuple; + + SparseMatrixCSR(); + SparseMatrixCSR(const SparseMatrixCSR& other); + SparseMatrixCSR(SparseMatrixCSR&& other) noexcept; + + explicit SparseMatrixCSR(int rows, int columns, std::function nz_per_row); + explicit SparseMatrixCSR(int rows, int columns, const std::vector& entries); + explicit SparseMatrixCSR(int rows, int columns, const std::vector& values, + const std::vector& column_indices, const std::vector& row_start_indices); + + SparseMatrixCSR& operator=(const SparseMatrixCSR& other); + SparseMatrixCSR& operator=(SparseMatrixCSR&& other) noexcept; + + int rows() const; + int columns() const; + int non_zero_size() const; + + int row_nz_size(int row) const; + + const int& row_nz_index(int row, int nz_index) const; + int& row_nz_index(int row, int nz_index); + + const T& row_nz_entry(int row, int nz_index) const; + T& row_nz_entry(int row, int nz_index); + + T* values_data() const; + int* column_indices_data() const; + int* row_start_indices_data() const; + + template + friend std::ostream& operator<<(std::ostream& stream, const SparseMatrixCSR& matrix); + +private: + int rows_; + int columns_; + int nnz_; + std::unique_ptr values_; + std::unique_ptr column_indices_; + std::unique_ptr row_start_indices_; +}; + +template +std::ostream& operator<<(std::ostream& stream, const SparseMatrixCSR& matrix) +{ + stream << "SparseMatrixCSR: " << matrix.rows_ << " x " << matrix.columns_ << "\n"; + stream << "Number of non-zeros (nnz): " << matrix.nnz_ << "\n"; + stream << "Non-zero elements (row, column, value):\n"; + for (int row = 0; row < matrix.rows_; ++row) { + for (int nnz = matrix.row_start_indices_[row]; nnz < matrix.row_start_indices_[row + 1]; ++nnz) { + stream << "(" << row << ", " << matrix.column_indices_[nnz] << ", " << matrix.values_[nnz] << ")\n"; + } + } + return stream; +} + +// default construction +template +SparseMatrixCSR::SparseMatrixCSR() + : rows_(0) + , columns_(0) + , nnz_(0) + , values_(nullptr) + , column_indices_(nullptr) + , row_start_indices_(nullptr) +{ +} + +// copy construction +template +SparseMatrixCSR::SparseMatrixCSR(const SparseMatrixCSR& other) + : rows_(other.rows_) + , columns_(other.columns_) + , nnz_(other.nnz_) + , values_(std::make_unique(nnz_)) + , column_indices_(std::make_unique(nnz_)) + , row_start_indices_(std::make_unique(rows_ + 1)) +{ + std::copy(other.values_.get(), other.values_.get() + nnz_, values_.get()); + std::copy(other.column_indices_.get(), other.column_indices_.get() + nnz_, column_indices_.get()); + std::copy(other.row_start_indices_.get(), other.row_start_indices_.get() + rows_ + 1, row_start_indices_.get()); +} + +// copy assignment +template +SparseMatrixCSR& SparseMatrixCSR::operator=(const SparseMatrixCSR& other) +{ + if (this == &other) { + // Self-assignment, no work needed + return *this; + } + // Only allocate new memory if the sizes are different + if (nnz_ != other.nnz_ || rows_ != other.rows_) { + values_ = std::make_unique(other.nnz_); + column_indices_ = std::make_unique(other.nnz_); + row_start_indices_ = std::make_unique(other.rows_ + 1); + } + // Copy the elements + rows_ = other.rows_; + columns_ = other.columns_; + nnz_ = other.nnz_; + std::copy(other.values_.get(), other.values_.get() + nnz_, values_.get()); + std::copy(other.column_indices_.get(), other.column_indices_.get() + nnz_, column_indices_.get()); + std::copy(other.row_start_indices_.get(), other.row_start_indices_.get() + rows_ + 1, row_start_indices_.get()); + return *this; +} + +// move construction +template +SparseMatrixCSR::SparseMatrixCSR(SparseMatrixCSR&& other) noexcept + : rows_(other.rows_) + , columns_(other.columns_) + , nnz_(other.nnz_) + , values_(std::move(other.values_)) + , column_indices_(std::move(other.column_indices_)) + , row_start_indices_(std::move(other.row_start_indices_)) +{ + other.nnz_ = 0; + other.rows_ = 0; + other.columns_ = 0; +} + +// move assignment +template +SparseMatrixCSR& SparseMatrixCSR::operator=(SparseMatrixCSR&& other) noexcept +{ + rows_ = other.rows_; + columns_ = other.columns_; + nnz_ = other.nnz_; + values_ = std::move(other.values_); + column_indices_ = std::move(other.column_indices_); + row_start_indices_ = std::move(other.row_start_indices_); + other.nnz_ = 0; + other.rows_ = 0; + other.columns_ = 0; + return *this; +} + +template +SparseMatrixCSR::SparseMatrixCSR(int rows, int columns, std::function nz_per_row) + : rows_(rows) + , columns_(columns) + , row_start_indices_(std::make_unique(rows_ + 1)) +{ + assert(rows >= 0); + assert(columns >= 0); + nnz_ = 0; + for (int i = 0; i < rows; i++) { + row_start_indices_[i] = nnz_; + nnz_ += nz_per_row(i); + } + row_start_indices_[rows] = nnz_; + values_ = std::make_unique(nnz_); + column_indices_ = std::make_unique(nnz_); +} + +template +SparseMatrixCSR::SparseMatrixCSR(int rows, int columns, const std::vector& entries) + : // entries: row_idx, col_idx, value + rows_(rows) + , columns_(columns) + , nnz_(entries.size()) + , values_(std::make_unique(nnz_)) + , column_indices_(std::make_unique(nnz_)) + , row_start_indices_(std::make_unique(rows_ + 1)) +{ + assert(rows >= 0); + assert(columns >= 0); + // fill values and column indexes + for (int i = 0; i < nnz_; i++) { + assert(0 <= std::get<0>(entries[i]) && std::get<0>(entries[i]) < rows); + values_[i] = std::get<2>(entries[i]); + column_indices_[i] = std::get<1>(entries[i]); + assert(0 <= column_indices_[i] && column_indices_[i] < columns); + } + //fill row indexes + int count = 0; + row_start_indices_[0] = 0; + for (int r = 0; r < rows; r++) { + while (count < nnz_ && std::get<0>(entries[count]) == r) + count++; + row_start_indices_[r + 1] = count; + } + assert(row_start_indices_[rows] == nnz_); +} + +template +SparseMatrixCSR::SparseMatrixCSR(int rows, int columns, const std::vector& values, + const std::vector& column_indices, const std::vector& row_start_indices) + : rows_(rows) + , columns_(columns) + , nnz_(values.size()) + , values_(std::make_unique(nnz_)) + , column_indices_(std::make_unique(nnz_)) + , row_start_indices_(std::make_unique(rows_ + 1)) +{ + assert(rows >= 0); + assert(columns >= 0); + assert(row_start_indices.size() == static_cast(rows + 1)); + assert(values.size() == column_indices.size()); + + // Copy data to internal storage + std::copy(values.begin(), values.end(), values_.get()); + std::copy(column_indices.begin(), column_indices.end(), column_indices_.get()); + std::copy(row_start_indices.begin(), row_start_indices.end(), row_start_indices_.get()); +} + +template +int SparseMatrixCSR::rows() const +{ + assert(this->rows_ >= 0); + return this->rows_; +} +template +int SparseMatrixCSR::columns() const +{ + assert(this->columns_ >= 0); + return this->columns_; +} +template +int SparseMatrixCSR::non_zero_size() const +{ + assert(this->nnz_ >= 0); + assert(static_cast(this->nnz_) <= static_cast(this->rows_) * static_cast(this->columns_)); + return this->nnz_; +} + +template +int SparseMatrixCSR::row_nz_size(int row) const +{ + assert(row >= 0 && row < rows_); + return row_start_indices_[row + 1] - row_start_indices_[row]; +} + +template +const int& SparseMatrixCSR::row_nz_index(int row, int nz_index) const +{ + assert(row >= 0 && row < rows_); + assert(nz_index >= 0 && nz_index < row_nz_size(row)); + return column_indices_[row_start_indices_[row] + nz_index]; +} + +template +int& SparseMatrixCSR::row_nz_index(int row, int nz_index) +{ + assert(row >= 0 && row < rows_); + assert(nz_index >= 0 && nz_index < row_nz_size(row)); + return column_indices_[row_start_indices_[row] + nz_index]; +} + +template +const T& SparseMatrixCSR::row_nz_entry(int row, int nz_index) const +{ + assert(row >= 0 && row < rows_); + assert(nz_index >= 0 && nz_index < row_nz_size(row)); + return values_[row_start_indices_[row] + nz_index]; +} + +template +T& SparseMatrixCSR::row_nz_entry(int row, int nz_index) +{ + assert(row >= 0 && row < rows_); + assert(nz_index >= 0 && nz_index < row_nz_size(row)); + return values_[row_start_indices_[row] + nz_index]; +} + +template +T* SparseMatrixCSR::values_data() const +{ + return values_.get(); +} + +template +int* SparseMatrixCSR::column_indices_data() const +{ + return column_indices_.get(); +} + +template +int* SparseMatrixCSR::row_start_indices_data() const +{ + return row_start_indices_.get(); +} \ No newline at end of file diff --git a/include/LinearAlgebra/diagonalSolver.h b/include/LinearAlgebra/diagonalSolver.h new file mode 100644 index 00000000..62b1cbd2 --- /dev/null +++ b/include/LinearAlgebra/diagonalSolver.h @@ -0,0 +1,165 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +template +class DiagonalSolver +{ +public: + DiagonalSolver(); + DiagonalSolver(const DiagonalSolver& other); + DiagonalSolver(DiagonalSolver&& other) noexcept; + + explicit DiagonalSolver(const int matrix_dimension); + + DiagonalSolver& operator=(const DiagonalSolver& other); + DiagonalSolver& operator=(DiagonalSolver&& other) noexcept; + + int rows() const; + int columns() const; + + const T& diagonal(const int index) const; + T& diagonal(const int index); + + void solveInPlace(T* sol_rhs) const; + + template + friend std::ostream& operator<<(std::ostream& stream, const DiagonalSolver& solver); + +private: + int matrix_dimension_; + std::unique_ptr diagonal_values_; +}; + +template +std::ostream& operator<<(std::ostream& stream, const DiagonalSolver& solver) +{ + stream << "Diagonal Matrix (Dimension: " << solver.matrix_dimension_ << " x " << solver.matrix_dimension_ << ")\n"; + + stream << "Diagonal Elements: ["; + for (int i = 0; i < solver.matrix_dimension_; ++i) { + stream << solver.diagonal(i); + if (i != solver.matrix_dimension_ - 1) + stream << ", "; + } + stream << "]\n"; + + return stream; +} + +// default construction +template +DiagonalSolver::DiagonalSolver() + : matrix_dimension_(0) + , diagonal_values_(nullptr) +{ +} + +// copy construction +template +DiagonalSolver::DiagonalSolver(const DiagonalSolver& other) + : matrix_dimension_(other.matrix_dimension_) + , diagonal_values_(std::make_unique(matrix_dimension_)) +{ + // Consider using a parllized OpenMP For-Loop instead + std::copy(other.diagonal_values_.get(), other.diagonal_values_.get() + matrix_dimension_, diagonal_values_.get()); +} + +// copy assignment +template +DiagonalSolver& DiagonalSolver::operator=(const DiagonalSolver& other) +{ + if (this == &other) { + // Self-assignment, no work needed + return *this; + } + // Only allocate new memory if the sizes are different + if (matrix_dimension_ != other.matrix_dimension_) { + matrix_dimension_ = other.matrix_dimension_; + diagonal_values_ = std::make_unique(matrix_dimension_); + } + // Consider using a parllized OpenMP For-Loop instead + std::copy(other.diagonal_values_.get(), other.diagonal_values_.get() + matrix_dimension_, diagonal_values_.get()); + return *this; +} + +// move construction +template +DiagonalSolver::DiagonalSolver(DiagonalSolver&& other) noexcept + : matrix_dimension_(other.matrix_dimension_) + , diagonal_values_(std::move(other.diagonal_values_)) +{ + other.matrix_dimension_ = 0; +} + +// move assignment +template +DiagonalSolver& DiagonalSolver::operator=(DiagonalSolver&& other) noexcept +{ + matrix_dimension_ = other.matrix_dimension_; + diagonal_values_ = std::move(other.diagonal_values_); + other.matrix_dimension_ = 0; + return *this; +} + +template +DiagonalSolver::DiagonalSolver(const int matrix_dimension) + : matrix_dimension_(matrix_dimension) + , diagonal_values_(std::make_unique(matrix_dimension_)) +{ + assert(matrix_dimension_ >= 1); + std::fill(diagonal_values_.get(), diagonal_values_.get() + matrix_dimension_, T(0)); +} + +template +int DiagonalSolver::rows() const +{ + assert(this->matrix_dimension_ >= 0); + return this->matrix_dimension_; +} +template +int DiagonalSolver::columns() const +{ + assert(this->matrix_dimension_ >= 0); + return this->matrix_dimension_; +} + +template +const T& DiagonalSolver::diagonal(const int index) const +{ + assert(index >= 0); + assert(index < this->matrix_dimension_); + return this->diagonal_values_[index]; +} +template +T& DiagonalSolver::diagonal(const int index) +{ + assert(index >= 0); + assert(index < this->matrix_dimension_); + return this->diagonal_values_[index]; +} + +// --------------- // +// Diagonal Solver // +// --------------- // + +template +void DiagonalSolver::solveInPlace(T* sol_rhs) const +{ + for (int i = 0; i < matrix_dimension_; i++) { + sol_rhs[i] /= diagonal(i); + } +} \ No newline at end of file diff --git a/include/LinearAlgebra/sparseLUSolver.h b/include/LinearAlgebra/sparseLUSolver.h new file mode 100644 index 00000000..fa5e4b67 --- /dev/null +++ b/include/LinearAlgebra/sparseLUSolver.h @@ -0,0 +1,252 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "csr_matrix.h" +#include "vector.h" + +/* LU decomposition Solver (slower than MUMPS) */ +/* Assumes that all diagonal elements are nonzero. */ +template +class SparseLUSolver +{ +public: + SparseLUSolver(); + SparseLUSolver(const SparseLUSolver& other); + SparseLUSolver(SparseLUSolver&& other) noexcept; + + explicit SparseLUSolver(const SparseMatrixCSR& A); + + SparseLUSolver& operator=(const SparseLUSolver& other); + SparseLUSolver& operator=(SparseLUSolver&& other) noexcept; + + void solveInPlace(Vector& b) const; + void solveInPlace(double* b) const; + +private: + std::vector L_values, U_values; + std::vector L_col_idx, U_col_idx; + std::vector L_row_ptr, U_row_ptr; + bool factorized_ = false; + + void factorize(const SparseMatrixCSR& A); + + void factorizeAccumulateSorted(const SparseMatrixCSR& A); + void factorizeWithHashing(const SparseMatrixCSR& A); +}; + +// default construction +template +SparseLUSolver::SparseLUSolver() + : factorized_(false) +{ +} + +// copy construction +template +SparseLUSolver::SparseLUSolver(const SparseLUSolver& other) + : L_values(other.L_values) + , U_values(other.U_values) + , L_col_idx(other.L_col_idx) + , U_col_idx(other.U_col_idx) + , L_row_ptr(other.L_row_ptr) + , U_row_ptr(other.U_row_ptr) + , factorized_(other.factorized_) +{ +} + +// copy assignment +template +SparseLUSolver& SparseLUSolver::operator=(const SparseLUSolver& other) +{ + if (this == &other) { + return *this; // Handle self-assignment + } + + L_values = other.L_values; + U_values = other.U_values; + L_col_idx = other.L_col_idx; + U_col_idx = other.U_col_idx; + L_row_ptr = other.L_row_ptr; + U_row_ptr = other.U_row_ptr; + factorized_ = other.factorized_; + + return *this; +} + +// move construction +template +SparseLUSolver::SparseLUSolver(SparseLUSolver&& other) noexcept + : L_values(std::move(other.L_values)) + , U_values(std::move(other.U_values)) + , L_col_idx(std::move(other.L_col_idx)) + , U_col_idx(std::move(other.U_col_idx)) + , L_row_ptr(std::move(other.L_row_ptr)) + , U_row_ptr(std::move(other.U_row_ptr)) + , factorized_(other.factorized_) +{ + other.factorized_ = false; +} + +// move assignment +template +SparseLUSolver& SparseLUSolver::operator=(SparseLUSolver&& other) noexcept +{ + if (this == &other) { + return *this; // Handle self-assignment + } + + L_values = std::move(other.L_values); + U_values = std::move(other.U_values); + L_col_idx = std::move(other.L_col_idx); + U_col_idx = std::move(other.U_col_idx); + L_row_ptr = std::move(other.L_row_ptr); + U_row_ptr = std::move(other.U_row_ptr); + factorized_ = other.factorized_; + + other.factorized_ = false; + + return *this; +} + +template +SparseLUSolver::SparseLUSolver(const SparseMatrixCSR& A) +{ + assert(A.rows() == A.columns()); + if (!factorized_) { + factorize(A); + } +} + +template +void SparseLUSolver::factorize(const SparseMatrixCSR& A) +{ + factorizeWithHashing(A); +} + +template +void SparseLUSolver::factorizeWithHashing(const SparseMatrixCSR& A) +{ + const int n = A.rows(); + L_values.clear(); + U_values.clear(); + L_col_idx.clear(); + U_col_idx.clear(); + L_row_ptr.clear(); + U_row_ptr.clear(); + + L_row_ptr.resize(n + 1, 0); + U_row_ptr.resize(n + 1, 0); + + // Temporary structures to store computed rows + std::vector> L_map(n); + std::vector> U_map(n); + + for (int i = 0; i < n; i++) { + std::unordered_map row_values; + + // Load nonzero elements of row i + for (int idx = 0; idx < A.row_nz_size(i); idx++) { + int j = A.row_nz_index(i, idx); + row_values[j] = A.row_nz_entry(i, idx); + } + + for (int j = 0; j < i; j++) { + auto it = row_values.find(j); + if (it == row_values.end()) + continue; + + // Compute L(i, j) using the diagonal U(j, j) + it->second /= U_map[j][j]; + L_map[i][j] = it->second; + + // Update the remaining values in row i using the jth row of U. + for (const auto& [k, U_val] : U_map[j]) { + if (k > j) { + row_values[k] -= it->second * U_val; + } + } + } + + for (const auto& [j, val] : row_values) { + if (j < i) + L_map[i][j] = val; + else + U_map[i][j] = val; + } + } + + // Convert L_map and U_map into CSR format + for (int i = 0; i < n; i++) { + for (const auto& [col, val] : L_map[i]) { + L_values.push_back(val); + L_col_idx.push_back(col); + } + L_row_ptr[i + 1] = L_values.size(); + + for (const auto& [col, val] : U_map[i]) { + U_values.push_back(val); + U_col_idx.push_back(col); + } + U_row_ptr[i + 1] = U_values.size(); + } + + factorized_ = true; +} + +template +void SparseLUSolver::solveInPlace(double* b) const +{ + assert(factorized_); + const int n = L_row_ptr.size() - 1; // n is the number of rows in the matrix + + // Forward substitution (L * b = b) -> b now holds y + for (int i = 0; i < n; i++) { + for (int idx = L_row_ptr[i]; idx < L_row_ptr[i + 1]; idx++) { + b[i] -= L_values[idx] * b[L_col_idx[idx]]; + } + } + + // Backward substitution (U * b = y) -> b now holds x + for (int i = n - 1; i >= 0; i--) { + T diag = 0; + for (int idx = U_row_ptr[i]; idx < U_row_ptr[i + 1]; idx++) { + int col = U_col_idx[idx]; + if (col == i) { + diag = U_values[idx]; // Store diagonal value + } + else { + b[i] -= U_values[idx] * b[col]; + } + } + if (std::abs(diag) < 1e-12) { + std::cerr << "Zero diagonal encountered in U at row " << i << "!\n"; + std::exit(EXIT_FAILURE); + } + b[i] /= diag; + } +} + +template +void SparseLUSolver::solveInPlace(Vector& b) const +{ + assert(b.size() == L_row_ptr.size() - 1); + solveInPlace(b.begin()); +} \ No newline at end of file diff --git a/include/LinearAlgebra/symmetricTridiagonalSolver.h b/include/LinearAlgebra/symmetricTridiagonalSolver.h new file mode 100644 index 00000000..64d0935e --- /dev/null +++ b/include/LinearAlgebra/symmetricTridiagonalSolver.h @@ -0,0 +1,512 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../common/equals.h" + +/* + * SymmetricTridiagonalSolver is a class for solving symmetric tridiagonal systems of linear equations. + * The system is represented by a matrix that has non-zero values only on the main diagonal, + * the sub-diagonal, and (optionally) the cyclic corner element (if cyclic boundary conditions are used). + * This class provides efficient solvers for both cyclic and non-cyclic symmetric tridiagonal matrices. + * + * The class supports the following: + * - Solving the system in-place using the `solveInPlace` method. + * - Handling both cyclic and non-cyclic boundary conditions. + * - Storing the matrix's main diagonal, sub-diagonal, and an optional cyclic corner element. + * - Peforming the Cholesky-Decomposition in-place. + * + * The primary method for solving the system is `solveInPlace`, which computes the solution to the system + * in place, updating the provided solution vector (`sol_rhs`) using intermediate storage (`temp1`, `temp2`). + * + * Temporary storage (`temp1` and `temp2`) of length 'matrix_dimension_' must be provided by the user. + * These temporary vectors are used for intermediate calculations during the solving process: + * - `temp1` is used in both non-cyclic and cyclic systems. + * - `temp2` is only required for cyclic systems. + * + * Usage: + * - Instantiate the solver with a specified matrix dimension. + * - Optionally set the cyclic boundary condition flag. + * - Call `solveInPlace` to solve the system, passing the solution vector and the appropriate temporary storage. + * + * The solver can handle both cyclic and non-cyclic matrices, and it uses efficient algorithms + * optimized for symmetric tridiagonal systems. + */ + +template +class SymmetricTridiagonalSolver +{ +public: + SymmetricTridiagonalSolver(); + SymmetricTridiagonalSolver(const SymmetricTridiagonalSolver& other); + SymmetricTridiagonalSolver(SymmetricTridiagonalSolver&& other) noexcept; + + explicit SymmetricTridiagonalSolver(const int matrix_dimension); + + SymmetricTridiagonalSolver& operator=(const SymmetricTridiagonalSolver& other); + SymmetricTridiagonalSolver& operator=(SymmetricTridiagonalSolver&& other) noexcept; + + void is_cyclic(bool value); + bool is_cyclic() const; + + int rows() const; + int columns() const; + + const T& main_diagonal(const int index) const; + T& main_diagonal(const int index); + + const T& sub_diagonal(const int index) const; + T& sub_diagonal(const int index); + + const T& cyclic_corner_element() const; + T& cyclic_corner_element(); + + // Unified Solve method + void solveInPlace(T* sol_rhs, T* temp1, T* temp2 = nullptr); + + template + friend std::ostream& operator<<(std::ostream& stream, const SymmetricTridiagonalSolver& solver); + +private: + int matrix_dimension_; + std::unique_ptr main_diagonal_values_; + std::unique_ptr sub_diagonal_values_; + T cyclic_corner_element_ = 0.0; + bool is_cyclic_ = true; + + bool factorized_ = false; + T gamma_ = 0.0; // Used in Shermann-Morrison factorization A = B + u*v^T + + // Solve methods: + // The notation 'u' and 'scratch' is directly taken from the implementation + // of the Thomas Algorithm listed on wikipedia. + // Note that the 'scratch' vector is unused, as we moved from the + // Thomas Algorithm to the faster Cholesky Decomposition. + void solveSymmetricTridiagonal(T* x, T* scratch); + void solveSymmetricCyclicTridiagonal(T* x, T* u, T* scratch); +}; + +template +std::ostream& operator<<(std::ostream& stream, const SymmetricTridiagonalSolver& solver) +{ + stream << "Symmetric Tridiagonal Matrix (Dimension: " << solver.matrix_dimension_ << ")\n"; + + if (solver.factorized_) { + // Print the L, D decomposition if factorized + stream << "L Factor (Sub Diagonal Elements): ["; + for (int i = 0; i < solver.matrix_dimension_ - 1; ++i) { + stream << solver.sub_diagonal(i); + if (i != solver.matrix_dimension_ - 2) + stream << ", "; + } + stream << "]\n"; + + stream << "D Factor (Diagonal Elements): ["; + for (int i = 0; i < solver.matrix_dimension_; ++i) { + stream << solver.main_diagonal(i); + if (i != solver.matrix_dimension_ - 1) + stream << ", "; + } + stream << "]\n"; + } + else { + // Print the matrix in its tridiagonal form if not factorized + stream << "Main Diagonal: ["; + for (int i = 0; i < solver.matrix_dimension_; ++i) { + stream << solver.main_diagonal(i); + if (i != solver.matrix_dimension_ - 1) + stream << ", "; + } + stream << "]\n"; + + stream << "Sub Diagonal: ["; + for (int i = 0; i < solver.matrix_dimension_ - 1; ++i) { + stream << solver.sub_diagonal(i); + if (i != solver.matrix_dimension_ - 2) + stream << ", "; + } + stream << "]\n"; + + if (solver.is_cyclic_) { + stream << "Cyclic Corner Element: " << solver.cyclic_corner_element() << "\n"; + } + else { + stream << "Matrix is not cyclic.\n"; + } + } + + return stream; +} + +// default construction +template +SymmetricTridiagonalSolver::SymmetricTridiagonalSolver() + : matrix_dimension_(0) + , main_diagonal_values_(nullptr) + , sub_diagonal_values_(nullptr) + , cyclic_corner_element_(0.0) + , is_cyclic_(true) +{ +} + +// copy construction +template +SymmetricTridiagonalSolver::SymmetricTridiagonalSolver(const SymmetricTridiagonalSolver& other) + : matrix_dimension_(other.matrix_dimension_) + , main_diagonal_values_(std::make_unique(matrix_dimension_)) + , sub_diagonal_values_(std::make_unique(matrix_dimension_ - 1)) + , cyclic_corner_element_(other.cyclic_corner_element_) + , is_cyclic_(other.is_cyclic_) +{ + std::copy(other.main_diagonal_values_.get(), other.main_diagonal_values_.get() + matrix_dimension_, + main_diagonal_values_.get()); + std::copy(other.sub_diagonal_values_.get(), other.sub_diagonal_values_.get() + matrix_dimension_ - 1, + sub_diagonal_values_.get()); +} + +// copy assignment +template +SymmetricTridiagonalSolver& SymmetricTridiagonalSolver::operator=(const SymmetricTridiagonalSolver& other) +{ + if (this == &other) { + // Self-assignment, no work needed + return *this; + } + // Only allocate new memory if the sizes are different + if (matrix_dimension_ != other.matrix_dimension_) { + matrix_dimension_ = other.matrix_dimension_; + main_diagonal_values_ = std::make_unique(matrix_dimension_); + sub_diagonal_values_ = std::make_unique(matrix_dimension_ - 1); + } + cyclic_corner_element_ = other.cyclic_corner_element_; + is_cyclic_ = other.is_cyclic_; + std::copy(other.main_diagonal_values_.get(), other.main_diagonal_values_.get() + matrix_dimension_, + main_diagonal_values_.get()); + std::copy(other.sub_diagonal_values_.get(), other.sub_diagonal_values_.get() + matrix_dimension_ - 1, + sub_diagonal_values_.get()); + return *this; +} + +// move construction +template +SymmetricTridiagonalSolver::SymmetricTridiagonalSolver(SymmetricTridiagonalSolver&& other) noexcept + : matrix_dimension_(other.matrix_dimension_) + , main_diagonal_values_(std::move(other.main_diagonal_values_)) + , sub_diagonal_values_(std::move(other.sub_diagonal_values_)) + , cyclic_corner_element_(other.cyclic_corner_element_) + , is_cyclic_(other.is_cyclic_) +{ + other.matrix_dimension_ = 0; + other.cyclic_corner_element_ = 0.0; + other.is_cyclic_ = true; +} + +// move assignment +template +SymmetricTridiagonalSolver& SymmetricTridiagonalSolver::operator=(SymmetricTridiagonalSolver&& other) noexcept +{ + matrix_dimension_ = other.matrix_dimension_; + main_diagonal_values_ = std::move(other.main_diagonal_values_); + sub_diagonal_values_ = std::move(other.sub_diagonal_values_); + cyclic_corner_element_ = other.cyclic_corner_element_; + is_cyclic_ = other.is_cyclic_; + other.matrix_dimension_ = 0; + other.cyclic_corner_element_ = 0.0; + other.is_cyclic_ = true; + return *this; +} + +template +SymmetricTridiagonalSolver::SymmetricTridiagonalSolver(const int matrix_dimension) + : matrix_dimension_(matrix_dimension) + , main_diagonal_values_(std::make_unique(matrix_dimension_)) + , sub_diagonal_values_(std::make_unique(matrix_dimension_ - 1)) + , cyclic_corner_element_(0.0) + , is_cyclic_(true) +{ + assert(matrix_dimension_ >= 1); + std::fill(main_diagonal_values_.get(), main_diagonal_values_.get() + matrix_dimension_, T(0)); + std::fill(sub_diagonal_values_.get(), sub_diagonal_values_.get() + matrix_dimension_ - 1, T(0)); +} + +template +void SymmetricTridiagonalSolver::is_cyclic(bool value) +{ + is_cyclic_ = value; +} +template +bool SymmetricTridiagonalSolver::is_cyclic() const +{ + return is_cyclic_; +} + +template +int SymmetricTridiagonalSolver::rows() const +{ + assert(this->matrix_dimension_ >= 0); + return this->matrix_dimension_; +} +template +int SymmetricTridiagonalSolver::columns() const +{ + assert(this->matrix_dimension_ >= 0); + return this->matrix_dimension_; +} + +template +const T& SymmetricTridiagonalSolver::main_diagonal(const int index) const +{ + assert(index >= 0); + assert(index < this->matrix_dimension_); + return this->main_diagonal_values_[index]; +} +template +T& SymmetricTridiagonalSolver::main_diagonal(const int index) +{ + assert(index >= 0); + assert(index < this->matrix_dimension_); + return this->main_diagonal_values_[index]; +} + +template +const T& SymmetricTridiagonalSolver::sub_diagonal(const int index) const +{ + assert(index >= 0); + assert(index < this->matrix_dimension_ - 1); + return this->sub_diagonal_values_[index]; +} +template +T& SymmetricTridiagonalSolver::sub_diagonal(const int index) +{ + assert(index >= 0); + assert(index < this->matrix_dimension_ - 1); + return this->sub_diagonal_values_[index]; +} + +template +const T& SymmetricTridiagonalSolver::cyclic_corner_element() const +{ + assert(is_cyclic_); + return this->cyclic_corner_element_; +} +template +T& SymmetricTridiagonalSolver::cyclic_corner_element() +{ + assert(is_cyclic_); + return this->cyclic_corner_element_; +} + +template +void SymmetricTridiagonalSolver::solveInPlace(T* sol_rhs, T* temp1, T* temp2) +{ + assert(matrix_dimension_ >= 2); + assert(sol_rhs != nullptr); + assert(temp1 != nullptr); + if (is_cyclic_) { + assert(temp2 != nullptr); + solveSymmetricCyclicTridiagonal(sol_rhs, temp1, temp2); + } + else { + solveSymmetricTridiagonal(sol_rhs, temp1); + } +} + +/* + * This algorithm implements the Tridiagonal Matrix Algorithm (TDMA) for solving + * symmetric tridiagonal systems of equations. The implementation is based on + * the principles outlined in the following resource: + * https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm. + */ + +template +void SymmetricTridiagonalSolver::solveSymmetricTridiagonal(T* x, T* scratch) +{ + /* ---------------------------------------------------------- */ + /* Based on Cholesky Decomposition: A = L * D * L^T + * + * This function performs Cholesky decomposition on a + * symmetric tridiagonal matrix, factorizing it into + * a lower triangular matrix (L) and a diagonal matrix (D). + * + * By storing the decomposition, this approach enhances + * efficiency for repeated solutions, as matrix factorizations + * need not be recalculated each time. + * ---------------------------------------------------------- */ + + // Cholesky Decomposition + if (!factorized_) { + for (int i = 1; i < matrix_dimension_; i++) { + assert(!equals(main_diagonal(i - 1), 0.0)); + sub_diagonal(i - 1) /= main_diagonal(i - 1); + main_diagonal(i) -= sub_diagonal(i - 1) * sub_diagonal(i - 1) * main_diagonal(i - 1); + } + factorized_ = true; + } + // Forward Substitution + for (int i = 1; i < matrix_dimension_; i++) { + x[i] -= sub_diagonal(i - 1) * x[i - 1]; + } + // Diagonal Scaling + for (int i = 0; i < matrix_dimension_; i++) { + assert(!equals(main_diagonal(i), 0.0)); + x[i] /= main_diagonal(i); + } + // Backward Substitution + for (int i = matrix_dimension_ - 2; i >= 0; i--) { + x[i] -= sub_diagonal(i) * x[i + 1]; + } + + /* --------------------------------------------------------------- */ + /* Thomas Algorithm: An alternative approach for solving + * tridiagonal systems that does not overwrite the matrix data. + * The algorithm is more stable than the previous approach. + * We enhances numerical stability by performing division directly + * rather than multiplying by the inverse. + * This reduces the risk of precision errors during computation. + * Requires additional 'scratch' storage. + * --------------------------------------------------------------- */ + + // assert(!equals(main_diagonal(0), 0.0)); + // scratch[0] = sub_diagonal(0) / main_diagonal(0); + // x[0] /= main_diagonal(0); + + // for (int i = 1; i < matrix_dimension_ - 1; i++) + // { + // const double divisor = main_diagonal(i) - sub_diagonal(i - 1) * scratch[i - 1]; + // assert(!equals(divisor, 0.0)); + // scratch[i] = sub_diagonal(i) / divisor; + // x[i] = (x[i] - sub_diagonal(i - 1) * x[i - 1]) / divisor; + // } + + // const int i = matrix_dimension_ - 1; + // const double divisor = main_diagonal(i) - sub_diagonal(i - 1) * scratch[i - 1]; + // assert(!equals(divisor, 0.0)); + // x[i] = (x[i] - sub_diagonal(i - 1) * x[i - 1]) / divisor; + + // for (int i = matrix_dimension_ - 2; i >= 0; i--) + // { + // x[i] -= scratch[i] * x[i + 1]; + // } +} + +// ------------------------- // +// Cyclic Tridiagonal Solver // +// ------------------------- // + +/* + * This algorithm implements the Tridiagonal Matrix Algorithm (TDMA) for solving + * symmetric tridiagonal systems of equations, specifically designed to handle + * cyclic boundary conditions. The implementation is based on principles outlined + * in the following resource: + * https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm. + */ + +template +void SymmetricTridiagonalSolver::solveSymmetricCyclicTridiagonal(T* x, T* u, T* scratch) +{ + /* ---------------------------------------------------------- */ + /* Cholesky Decomposition: A = L * D * L^T + * This step factorizes the tridiagonal matrix into lower + * triangular (L) and diagonal (D) matrices. While this + * approach may be slightly less stable, it can offer improved + * performance for repeated solves due to the factorization + * being stored internally. + * ---------------------------------------------------------- */ + + // Cholesky Decomposition + if (!factorized_) { + // Shermann-Morrison Adjustment + gamma_ = -main_diagonal(0); + main_diagonal(0) -= gamma_; + main_diagonal(matrix_dimension_ - 1) -= cyclic_corner_element() * cyclic_corner_element() / gamma_; + + for (int i = 1; i < matrix_dimension_; i++) { + sub_diagonal(i - 1) /= main_diagonal(i - 1); + main_diagonal(i) -= sub_diagonal(i - 1) * sub_diagonal(i - 1) * main_diagonal(i - 1); + } + factorized_ = true; + } + // Forward Substitution + u[0] = gamma_; + for (int i = 1; i < matrix_dimension_; i++) { + x[i] -= sub_diagonal(i - 1) * x[i - 1]; + if (i < matrix_dimension_ - 1) + u[i] = 0.0 - sub_diagonal(i - 1) * u[i - 1]; + else + u[i] = cyclic_corner_element() - sub_diagonal(i - 1) * u[i - 1]; + } + // Diagonal Scaling + for (int i = 0; i < matrix_dimension_; i++) { + x[i] /= main_diagonal(i); + u[i] /= main_diagonal(i); + } + // Backward Substitution + for (int i = matrix_dimension_ - 2; i >= 0; i--) { + x[i] -= sub_diagonal(i) * x[i + 1]; + u[i] -= sub_diagonal(i) * u[i + 1]; + } + // Shermann-Morrison Reonstruction + const double dot_product_x_v = x[0] + cyclic_corner_element() / gamma_ * x[matrix_dimension_ - 1]; + const double dot_product_u_v = u[0] + cyclic_corner_element() / gamma_ * u[matrix_dimension_ - 1]; + const double factor = dot_product_x_v / (1.0 + dot_product_u_v); + + for (int i = 0; i < matrix_dimension_; i++) { + x[i] -= factor * u[i]; + } + + /* --------------------------------------------------------------- */ + /* Thomas Algorithm: An alternative approach for solving + * tridiagonal systems that does not overwrite the matrix data. + * The algorithm is more stable than the previous approach. + * We enhances numerical stability by performing division directly + * rather than multiplying by the inverse. + * This reduces the risk of precision errors during computation. + * Requires additional storage in scratch. + * --------------------------------------------------------------- */ + + // const double gamma = -main_diagonal(0); + // const double first_main_diagonal = main_diagonal(0) - gamma; + // const double last_main_diagonal = main_diagonal(matrix_dimension_ - 1) - cyclic_corner_element() * cyclic_corner_element() / gamma; + + // scratch[0] = sub_diagonal(0) / first_main_diagonal; + // x[0] /= first_main_diagonal; + // u[0] = gamma / first_main_diagonal; + + // for (int i = 1; i < matrix_dimension_ - 1; i++) + // { + // const double divisor = main_diagonal(i) - sub_diagonal(i - 1) * scratch[i - 1]; + // scratch[i] = sub_diagonal(i) / divisor; + // x[i] = (x[i] - sub_diagonal(i - 1) * x[i - 1]) / divisor; + // u[i] = (0.0 - sub_diagonal(i - 1) * u[i - 1]) / divisor; + // } + + // const int i = matrix_dimension_ - 1; + // const double divisor = last_main_diagonal - sub_diagonal(i - 1) * scratch[i - 1]; + // x[i] = (x[i] - sub_diagonal(i - 1) * x[i - 1]) / divisor; + // u[i] = (cyclic_corner_element() - sub_diagonal(i - 1) * u[i - 1]) / divisor; + + // for (int i = matrix_dimension_ - 2; i >= 0; i--) + // { + // x[i] -= scratch[i] * x[i + 1]; + // u[i] -= scratch[i] * u[i + 1]; + // } + + // const double dot_product_x_v = x[0] + cyclic_corner_element() / gamma * x[matrix_dimension_ - 1]; + // const double dot_product_u_v = u[0] + cyclic_corner_element() / gamma * u[matrix_dimension_ - 1]; + // const double factor = dot_product_x_v / (1.0 + dot_product_u_v); + + // for (int i = 0; i < matrix_dimension_; i++) + // { + // x[i] -= factor * u[i]; + // } +} diff --git a/include/LinearAlgebra/vector.h b/include/LinearAlgebra/vector.h new file mode 100644 index 00000000..b5d3335d --- /dev/null +++ b/include/LinearAlgebra/vector.h @@ -0,0 +1,191 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +template +class Vector +{ +public: + Vector(); + Vector(const Vector& other); + Vector(Vector&& other) noexcept; + + explicit Vector(int size); + Vector(const std::initializer_list& init); + Vector(const std::vector& init); + + Vector& operator=(const Vector& other); + Vector& operator=(Vector&& other) noexcept; + + int size() const noexcept; + + inline const T& operator[](int index) const; + inline T& operator[](int index); + + T* begin() noexcept; + T* end() noexcept; + const T* begin() const noexcept; + const T* end() const noexcept; + + template + friend std::ostream& operator<<(std::ostream& stream, const Vector& vector); + +private: + int size_; + std::unique_ptr values_; +}; + +template +std::ostream& operator<<(std::ostream& stream, const Vector& vector) +{ + stream << "["; + for (int i = 0; i < vector.size(); ++i) { + stream << vector[i]; + if (i != vector.size() - 1) + stream << ", "; + } + stream << "]\n"; + return stream; +} + +// default construction +template +Vector::Vector() + : size_(0) + , values_(nullptr) +{ +} + +// copy construction +template +Vector::Vector(const Vector& other) + : size_(other.size_) + , values_(std::make_unique(size_)) +{ +#pragma omp parallel for if (size_ > 10'000) + for (int i = 0; i < size_; ++i) { + values_[i] = other.values_[i]; + } +} + +// copy assignment +template +Vector& Vector::operator=(const Vector& other) +{ + if (this == &other) { + /* Self-assignment, no work needed */ + return *this; + } + + /* Allocate new memory if necessary */ + if (size_ != other.size_) { + size_ = other.size_; + values_ = std::make_unique(size_); + } + +#pragma omp parallel for if (size_ > 10'000) + for (int i = 0; i < size_; ++i) { + values_[i] = other.values_[i]; + } + + return *this; +} + +// move construction +template +Vector::Vector(Vector&& other) noexcept + : size_(other.size_) + , values_(std::move(other.values_)) +{ + other.size_ = 0; +} + +// move assignment +template +Vector& Vector::operator=(Vector&& other) noexcept +{ + if (this != &other) { + size_ = other.size_; + values_ = std::move(other.values_); + other.size_ = 0; + } + return *this; +} + +// constrcutor with size +template +Vector::Vector(int size) + : size_(size) + , values_(std::make_unique(size_)) +{ +} + +// constructor with initialization +template +Vector::Vector(const std::initializer_list& init) + : size_(static_cast(init.size())) + , values_(std::make_unique(size_)) +{ + std::copy(init.begin(), init.end(), values_.get()); +} +// constructor with std::vector initialization +template +Vector::Vector(const std::vector& init) + : size_(static_cast(init.size())) + , values_(std::make_unique(size_)) +{ + assert(!init.empty()); + std::copy(init.begin(), init.end(), values_.get()); +} + +// getter [] +template +inline const T& Vector::operator[](int index) const +{ + assert(index >= 0); + assert(index < size_); + return values_[index]; +} +// setter [] +template +inline T& Vector::operator[](int index) +{ + assert(index >= 0); + assert(index < size_); + return values_[index]; +} +// get vector's size +template +int Vector::size() const noexcept +{ + return size_; +} + +template +T* Vector::begin() noexcept +{ + return values_.get(); +} +template +T* Vector::end() noexcept +{ + return values_.get() + size_; +} + +template +const T* Vector::begin() const noexcept +{ + return values_.get(); +} + +template +const T* Vector::end() const noexcept +{ + return values_.get() + size_; +} diff --git a/include/LinearAlgebra/vector_operations.h b/include/LinearAlgebra/vector_operations.h new file mode 100644 index 00000000..bc2a08bb --- /dev/null +++ b/include/LinearAlgebra/vector_operations.h @@ -0,0 +1,151 @@ +#pragma once + +#include +#include +#include + +#include "../common/equals.h" +#include "vector.h" + +template +bool equals(const Vector& lhs, const Vector& rhs) +{ + if (lhs.size() != rhs.size()) { + return false; + } + + const std::size_t n = lhs.size(); + for (std::size_t i = 0; i < n; ++i) { + if (!equals(lhs[i], rhs[i])) { + return false; + } + } + return true; +} + +template +void assign(Vector& lhs, const T& value) +{ + std::size_t n = lhs.size(); +#pragma omp parallel for if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + lhs[i] = value; + } +} + +template +void add(Vector& result, const Vector& x) +{ + if (result.size() != x.size()) { + throw std::invalid_argument("Vectors must be of the same size."); + } + std::size_t n = result.size(); +#pragma omp parallel for if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + result[i] += x[i]; + } +} + +template +void add(Vector& result, const Vector& x, const int m) +{ + if (result.size() != x.size()) { + throw std::invalid_argument("Vectors must be of the same size."); + } + std::size_t n = result.size(); +#pragma omp parallel for if (n > m) + for (std::size_t i = 0; i < n; ++i) { + result[i] += x[i]; + } +} + +template +void subtract(Vector& result, const Vector& x) +{ + if (result.size() != x.size()) { + throw std::invalid_argument("Vectors must be of the same size."); + } + std::size_t n = result.size(); +#pragma omp parallel for if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + result[i] -= x[i]; + } +} + +template +void linear_combination(Vector& x, const T& alpha, const Vector& y, const T& beta) +{ + if (x.size() != y.size()) { + throw std::invalid_argument("Vectors must be of the same size."); + } + std::size_t n = x.size(); +#pragma omp parallel for if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + x[i] = alpha * x[i] + beta * y[i]; + } +} + +template +void multiply(Vector& x, const T& alpha) +{ + std::size_t n = x.size(); +#pragma omp parallel for if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + x[i] *= alpha; + } +} + +template +T dot_product(const Vector& lhs, const Vector& rhs) +{ + if (lhs.size() != rhs.size()) { + throw std::invalid_argument("Vectors must be of the same size."); + } + + T result = 0.0; + std::size_t n = lhs.size(); +#pragma omp parallel for reduction(+ : result) if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + result += lhs[i] * rhs[i]; + } + return result; +} + +template +T l1_norm(const Vector& x) +{ + T result = 0.0; + std::size_t n = x.size(); +#pragma omp parallel for reduction(+ : result) if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + result += std::abs(x[i]); + } + return result; +} + +template +T l2_norm_squared(const Vector& x) +{ + T result = 0.0; + std::size_t n = x.size(); +#pragma omp parallel for reduction(+ : result) if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + result += x[i] * x[i]; + } + return result; +} + +template +T infinity_norm(const Vector& x) +{ + T result = 0.0; + std::size_t n = x.size(); +#pragma omp parallel for reduction(max : result) if (n > 10'000) + for (std::size_t i = 0; i < n; ++i) { + T abs_value = std::abs(x[i]); + if (abs_value > result) { + result = abs_value; + } + } + return result; +} diff --git a/include/PolarGrid/multiindex.h b/include/PolarGrid/multiindex.h new file mode 100755 index 00000000..32508f0b --- /dev/null +++ b/include/PolarGrid/multiindex.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include + +#include "../common/space_dimension.h" + +class MultiIndex +{ +public: + static_assert(space_dimension > 0 && space_dimension <= 3, "Invalid space dimension"); + + //! Creates a multi index with undefined coordinate values. + MultiIndex() = default; + + //! Initializes all coordinate values of the multi index with `value`. + explicit MultiIndex(int value); + //! Initializes 2-dimensional multi index coordinate values with `i` and `j`. + //! Works only if `space_dimension` is 2. + explicit MultiIndex(int i, int j); + //! Initializes 3-dimensional multi index coordinate values with `i`, `j` and `k`. + //! Works only if `space_dimension` is 3. + explicit MultiIndex(int i, int j, int k); + + //! Returns the size of the multi index. + //! This is equal to `space_dimension`. + int size() const; + + //! Tests if two multi indices are equal + bool operator==(const MultiIndex& other) const; + //! Tests if two multi indices are inequal + bool operator!=(const MultiIndex& other) const; + + //! Returns the `i`th coordinate value of the multi index. + const int& operator[](int i) const; + + //! Returns a mutable reference to the `i`th coordinate value of the multi index. + int& operator[](int i); + + int* data(); + const int* data() const; + +private: + int data_[space_dimension]; +}; \ No newline at end of file diff --git a/include/PolarGrid/point.h b/include/PolarGrid/point.h new file mode 100755 index 00000000..534e801d --- /dev/null +++ b/include/PolarGrid/point.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include + +#include "../common/equals.h" +#include "../common/space_dimension.h" + +class Point +{ +public: + static_assert(space_dimension > 0 && space_dimension <= 3, "Invalid space dimension"); + + //! Creates a point with undefined coordinate values. + Point() = default; + + //! Initializes all coordinate values of the point with `value`. + explicit Point(double value); + //! Initializes 2-dimensional point coordinate values with `x` and `y`. + //! Works only if `space_dimension` is 2. + explicit Point(double x, double y); + //! Initializes 3-dimensional point coordinate values with `x`, `y` and `z`. + //! Works only if `space_dimension` is 3. + explicit Point(double x, double y, double z); + + //! Returns the size of the point. + //! This is equal to `space_dimension`. + int size() const; + + //! Returns the `i`th coordinate value of the point. + const double& operator[](int i) const; + + //! Returns a mutable reference to the `i`th coordinate value of the point. + double& operator[](int i); + +private: + double data_[space_dimension]; +}; + +bool equals(const Point& lhs, const Point& rhs); +double norm(const Point& point); +void add(Point& result, const Point& lhs, const Point& rhs); +void subtract(Point& result, const Point& lhs, const Point& rhs); +void multiply(Point& result, const double& scalar, const Point& lhs); \ No newline at end of file diff --git a/include/PolarGrid/polargrid.h b/include/PolarGrid/polargrid.h new file mode 100644 index 00000000..1302b7e2 --- /dev/null +++ b/include/PolarGrid/polargrid.h @@ -0,0 +1,207 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "../common/equals.h" + +#include "../PolarGrid/multiindex.h" +#include "../PolarGrid/point.h" + +// The PolarGrid class implements a donut-shaped 2D grid. +// It is designed to handle polar coordinates, providing functionalities +// for storing data points and performing operations on them. + +class PolarGrid +{ +public: + // Default constructor. + explicit PolarGrid() = default; + + // Constructor to initialize grid using vectors of radii and angles. + PolarGrid(const std::vector& radii, const std::vector& angles, + std::optional splitting_radius = std::nullopt); + + // Constructor to initialize grid using data from text files containing radii and angles. + PolarGrid(const std::string& file_grid_radii, const std::string& file_grid_angles, + std::optional splitting_radius = std::nullopt); + + // Constructor to initialize grid using parameters from GMGPolar. + explicit PolarGrid(const double& R0, const double& Rmax, const int nr_exp, const int ntheta_exp, + const double& refinement_radius, const int anisotropic_factor, const int divideBy2, + std::optional splitting_radius = std::nullopt); + + // Optimized, inlined indexing. + int wrapThetaIndex(const int unwrapped_theta_index) const; + int index(const int r_index, const int unwrapped_theta_index) const; + int fastIndex(const int r_index, const int theta_index) const; + void multiIndex(const int node_index, int& r_index, int& theta_index) const; + + // Number of grid nodes + int numberOfNodes() const; + // Grid Parameters + // Get the number of grid points in radial direction + int nr() const; + // Get the number of angular divisions + int ntheta() const; + // Get the radius at a specific radial index + const double& radius(const int r_index) const; + // Get the angle at a specific angular index + const double& theta(const int theta_index) const; + // Get all radii and angles available which define the grid + const std::vector& radii() const; + const std::vector& angles() const; + + // Grid distances + // Get the radial distance to the next consecutive radial node at a specified radial index. + const double& radialSpacing(const int r_index) const; + // Get the angular distance to the next consecutive angular node at a specified unwrapped angular index. + const double& angularSpacing(const int unwrapped_theta_index) const; + + // Circle/radial smoother division + // Get the radius which splits the grid into circular and radial smoothing + double smootherSplittingRadius() const; + // Get the number of circles in the circular smoother. + int numberSmootherCircles() const; + // Get the length of the radial smoother lines. + int lengthSmootherRadial() const; + // Get the number of nodes in circular smoother. + int numberCircularSmootherNodes() const; + // Get the number of nodes in radial smoother. + int numberRadialSmootherNodes() const; + + // Implementation in src/PolarGrid/load_write_grid.cpp + // Write the grid data to files specified for radii and angles with given precision. + void writeToFile(const std::string& file_r, const std::string& file_theta, const int precision) const; + + // ------------------------------------------- // + // Unoptimized Indexing and Neighbor Retrieval // + // ------------------------------------------- // + // Node Indexing (based on the combined circle-radial smoother) + // Get the index of a node based on its position. + int index(const MultiIndex& position) const; + // Get the position of a node based on its index. + MultiIndex multiIndex(const int node_index) const; + // Get the polar coordinates of a node based on its position. + Point polarCoordinates(const MultiIndex& position) const; + // Get adjacent neighbors of a node. + // If the neighbor index is -1, then there is no neighboring node in that direction. + // - The first entry (neighbors[0]) represents the radial direction (r): + // - First: inward neighbor (r - 1) + // - Second: outward neighbor (r + 1) + // - The second entry (neighbors[1]) represents the angular direction (theta): + // - First: counterclockwise neighbor (theta - 1) + // - Second: clockwise neighbor (theta + 1) + void adjacentNeighborsOf(const MultiIndex& position, + std::array, space_dimension>& neighbors) const; + // Get diagonal neighbors of a node. + // If the neighbor index is -1, then there is no neighboring node in that direction. + // - The first entry (neighbors[0]) represents: + // - First: bottom left neighbor (r - 1, theta - 1) + // - Second: bottom right neighbor (r + 1, theta - 1) + // - The second entry (neighbors[1]) represents: + // - First: top left neighbor (r - 1, theta + 1) + // - Second: top right neighbor (r + 1, theta + 1) + void diagonalNeighborsOf(const MultiIndex& position, + std::array, space_dimension>& neighbors) const; + // Neighbor distances + // Get distances to adjacent neighbors of a node. + // If there is no neighboring node in that direction, then the neighbor distance is 0. + void adjacentNeighborDistances(const MultiIndex& position, + std::array, space_dimension>& neighbor_distances) const; + +private: + // --------------- // + // Private members // + // --------------- // + + // We will use the convention: + // radii = [R0, ..., R], angles = [0, ..., 2*pi] + // Note that ntheta will be one less than the size of angles since 0 and 2pi are the same point. + int nr_; // number of nodes in radial direction + int ntheta_; // number of (unique) nodes in angular direction + bool is_ntheta_PowerOfTwo_; + std::vector radii_; // Vector of radial coordiantes + std::vector angles_; // Vector of angular coordinates + + // radial_spacings_ contains the distances between each consecutive radii division. + // radial_spacings_ = [r_{1}-r_{0}, ..., r_{N}-r_{N-1}]. + std::vector radial_spacings_; // size(radial_spacings_) = nr() - 1 + + // angular_spacings_ contains the angles between each consecutive theta division. + // Since we have a periodic boundary in theta direction, + // we have to make sure the index wraps around correctly when accessing it. + // Here theta_0 = 0.0 and theta_N = 2*pi refer to the same point. + // angular_spacings_ = [theta_{1}-theta_{0}, ..., theta_{N}-theta_{N-1}]. + std::vector angular_spacings_; // size(angular_spacings_) = ntheta() + + // Circle/radial smoother division + double smoother_splitting_radius_; // Radius at which the grid is split into circular and radial smoothing + int number_smoother_circles_; // Number of smoother circles in the grid + int length_smoother_radial_; // Length of the radial smoother lines. + int number_circular_smoother_nodes_; // Number of nodes in the circular smoother + int number_radial_smoother_nodes_; // Number of nodes in the radial smoother + + /* + * Relationship constraints: + * - radius(numberSmootherCircles) <= smoother_splitting_radius < radius(numberSmootherCircles + 1) + * - numberSmootherCircles + lengthSmootherRadial = nr() + * - numberCircularSmootherNodes + numberRadialSmootherNodes = number_of_nodes() + */ + + // ------------------------ // + // Private Helper Functions // + // ------------------------ // + + // Check parameter validity + void checkParameters(const std::vector& radii, const std::vector& angles) const; + // Initialize radial_spacings_, angular_spacings_ + void initializeDistances(); + + // Initializes line splitting parameters for Circle/radial indexing. + // splitting_radius: The radius value used for dividing the smoother into a circular and radial section. + // If std::nullopt, automatic line-splitting is enabled. + // If the splitting radius is less than R0, only Radial indexing is used. + // If the splitting radius is greater than or equal to R, only Circular indexing is used. + void initializeLineSplitting(std::optional splitting_radius); + + // Construct radial divisions for grid generation. + void constructRadialDivisions(const double& R0, const double& R, const int nr_exp, const double& refinement_radius, + const int anisotropic_factor); + // Construct angular divisions for grid generation. + void constructAngularDivisions(const int ntheta_exp, const int nr); + + // Refine the grid by dividing radial and angular divisions by 2. + void refineGrid(const int divideBy2); + std::vector divideVector(const std::vector& vec, const int divideBy2) const; + + // Help constrcut radii_ when an anisotropic radial division is requested + // Implementation in src/PolarGrid/anisotropic_division.cpp + void RadialAnisotropicDivision(std::vector& r_temp, const double& R0, const double& R, const int nr_exp, + const double& refinement_radius, const int anisotropic_factor) const; + + // Implementation in src/PolarGrid/load_write_grid.cpp + void writeVectorToFile(const std::string& filename, const std::vector& vector, const int precision) const; + void loadVectorFromFile(const std::string& filename, std::vector& vector) const; +}; + +// ---------------------------------------------------- // +// Generates a coarser PolarGrid from a finer PolarGrid // +// ---------------------------------------------------- // +PolarGrid coarseningGrid(const PolarGrid& grid); + +#include "polargrid.inl" // Include the inline function definitions \ No newline at end of file diff --git a/include/PolarGrid/polargrid.inl b/include/PolarGrid/polargrid.inl new file mode 100755 index 00000000..ab15d374 --- /dev/null +++ b/include/PolarGrid/polargrid.inl @@ -0,0 +1,119 @@ +#pragma once + +#include "polargrid.h" + +inline int PolarGrid::nr() const +{ + return nr_; +} +inline int PolarGrid::ntheta() const +{ + return ntheta_; +} + +inline int PolarGrid::numberOfNodes() const +{ + return nr() * ntheta(); +} + +inline const double& PolarGrid::radius(const int r_index) const +{ + assert(r_index >= 0 && static_cast(r_index) < radii_.size()); + return radii_[r_index]; +} + +inline const double& PolarGrid::theta(const int theta_index) const +{ + assert(theta_index >= 0 && static_cast(theta_index) < angles_.size()); + return angles_[theta_index]; +} + +// Get the number of circles in the circular smoother. +inline int PolarGrid::numberSmootherCircles() const +{ + return number_smoother_circles_; +} +// Get the length of the radial smoother lines. +inline int PolarGrid::lengthSmootherRadial() const +{ + return length_smoother_radial_; +} + +// Get the number of nodes in circular smoother. +inline int PolarGrid::numberCircularSmootherNodes() const +{ + return number_circular_smoother_nodes_; +} +// Get the number of nodes in radial smoother. +inline int PolarGrid::numberRadialSmootherNodes() const +{ + return number_radial_smoother_nodes_; +} + +inline const double& PolarGrid::radialSpacing(const int r_index) const +{ + assert(r_index >= 0 && static_cast(r_index) < radial_spacings_.size()); + return radial_spacings_[r_index]; +} + +inline const double& PolarGrid::angularSpacing(const int unwrapped_theta_index) const +{ + // unwrapped_theta_index may be negative or larger than ntheta() to allow for periodicity. + const int theta_index = wrapThetaIndex(unwrapped_theta_index); + assert(theta_index >= 0 && theta_index < ntheta()); + return angular_spacings_[theta_index]; +} + +// ------------------ // +// Optimized indexing // +// ------------------ // + +inline int PolarGrid::wrapThetaIndex(const int unwrapped_theta_index) const +{ + // The unwrapped_theta_index may be negative or exceed the number of theta steps (ntheta()), + // so we need to wrap it into the valid range [0, ntheta() - 1] to maintain periodicity. + // + // When ntheta is a power of 2 (i.e., ntheta = 2^k), we can optimize the modulo operation: + // - ntheta() - 1 yields a bitmask with the lower k bits set to 1. + // For example, if ntheta() is 8 (2^3), then ntheta() - 1 equals 7, which in binary is 0b111. + // - Applying the bitwise AND operator (&) with this mask extracts the lower k bits of unwrapped_theta_index. + // This effectively computes unwrapped_theta_index % ntheta(), because it discards all higher bits. + // + // If ntheta is not a power of two, we use the standard modulo approach to handle wrapping. + return is_ntheta_PowerOfTwo_ ? unwrapped_theta_index & (ntheta() - 1) : (unwrapped_theta_index % ntheta() + ntheta()) % ntheta(); +} + +inline int PolarGrid::index(const int r_index, const int unwrapped_theta_index) const +{ + // unwrapped_theta_index may be negative or larger than ntheta() to allow for periodicity. + assert(0 <= r_index && r_index < nr()); + const int theta_index = wrapThetaIndex(unwrapped_theta_index); + assert(0 <= theta_index && theta_index < ntheta()); + return r_index < numberSmootherCircles() + ? theta_index + ntheta() * r_index + : numberCircularSmootherNodes() + r_index - numberSmootherCircles() + lengthSmootherRadial() * theta_index; +} + +inline int PolarGrid::fastIndex(const int r_index, const int theta_index) const +{ + assert(0 <= r_index && r_index < nr()); + assert(0 <= theta_index && theta_index < ntheta()); + return r_index < numberSmootherCircles() + ? theta_index + ntheta() * r_index + : numberCircularSmootherNodes() + r_index - numberSmootherCircles() + lengthSmootherRadial() * theta_index; +} + +inline void PolarGrid::multiIndex(const int node_index, int& r_index, int& theta_index) const +{ + assert(0 <= node_index && node_index < numberOfNodes()); + if (node_index < numberCircularSmootherNodes()) + { + r_index = node_index / ntheta(); + theta_index = is_ntheta_PowerOfTwo_ ? node_index & (ntheta() - 1) : node_index % ntheta(); + } + else + { + theta_index = (node_index - numberCircularSmootherNodes()) / lengthSmootherRadial(); + r_index = numberSmootherCircles() + (node_index - numberCircularSmootherNodes()) % lengthSmootherRadial(); + } +} diff --git a/include/Residual/ResidualGive/residualGive.h b/include/Residual/ResidualGive/residualGive.h new file mode 100644 index 00000000..5a3865af --- /dev/null +++ b/include/Residual/ResidualGive/residualGive.h @@ -0,0 +1,18 @@ +#pragma once + +#include "../residual.h" + +class ResidualGive : public Residual +{ +public: + explicit ResidualGive(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, const bool DirBC_Interior, + const int num_omp_threads); + ~ResidualGive() override = default; + + void computeResidual(Vector& result, const Vector& rhs, const Vector& x) const override; + +private: + void applyCircleSection(const int i_r, Vector& result, const Vector& x) const; + void applyRadialSection(const int i_theta, Vector& result, const Vector& x) const; +}; \ No newline at end of file diff --git a/include/Residual/ResidualTake/residualTake.h b/include/Residual/ResidualTake/residualTake.h new file mode 100644 index 00000000..b8de553c --- /dev/null +++ b/include/Residual/ResidualTake/residualTake.h @@ -0,0 +1,20 @@ +#pragma once + +#include "../residual.h" + +class ResidualTake : public Residual +{ +public: + explicit ResidualTake(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, const bool DirBC_Interior, + const int num_omp_threads); + ~ResidualTake() override = default; + + void computeResidual(Vector& result, const Vector& rhs, const Vector& x) const override; + +private: + void applyCircleSection(const int i_r, Vector& result, const Vector& rhs, + const Vector& x) const; + void applyRadialSection(const int i_theta, Vector& result, const Vector& rhs, + const Vector& x) const; +}; \ No newline at end of file diff --git a/include/Residual/residual.h b/include/Residual/residual.h new file mode 100644 index 00000000..84796d31 --- /dev/null +++ b/include/Residual/residual.h @@ -0,0 +1,40 @@ +#pragma once + +class LevelCache; +class Level; + +#include +#include +#include + +#include "../PolarGrid/polargrid.h" + +#include "../InputFunctions/boundaryConditions.h" +#include "../InputFunctions/densityProfileCoefficients.h" +#include "../InputFunctions/domainGeometry.h" +#include "../InputFunctions/sourceTerm.h" +#include "../Level/level.h" +#include "../LinearAlgebra/vector.h" +#include "../LinearAlgebra/vector_operations.h" +#include "../common/global_definitions.h" + +class Residual +{ +public: + explicit Residual(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, const bool DirBC_Interior, + const int num_omp_threads); + virtual ~Residual() = default; + + virtual void computeResidual(Vector& result, const Vector& rhs, const Vector& x) const = 0; + +protected: + /* ------------------- */ + /* Constructor members */ + const PolarGrid& grid_; + const LevelCache& level_cache_; + const DomainGeometry& domain_geometry_; + const DensityProfileCoefficients& density_profile_coefficients_; + const bool DirBC_Interior_; + const int num_omp_threads_; +}; diff --git a/include/Smoother/SmootherGive/smootherGive.h b/include/Smoother/SmootherGive/smootherGive.h new file mode 100644 index 00000000..91b6a6f2 --- /dev/null +++ b/include/Smoother/SmootherGive/smootherGive.h @@ -0,0 +1,102 @@ +#pragma once + +#include "../smoother.h" + +#ifdef GMGPOLAR_USE_MUMPS + #include "dmumps_c.h" + #include "mpi.h" +#endif + +class SmootherGive : public Smoother +{ +public: + explicit SmootherGive(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + ~SmootherGive() override; + + void smoothing(Vector& x, const Vector& rhs, Vector& temp) override; + +private: + void smoothingSequential(Vector& x, const Vector& rhs, Vector& temp); + void smoothingForLoop(Vector& x, const Vector& rhs, + Vector& temp); /* This is the fastest option */ + void smoothingTaskLoop(Vector& x, const Vector& rhs, Vector& temp); + void smoothingTaskDependencies(Vector& x, const Vector& rhs, Vector& temp); + + // The A_sc matrix on i_r = 0 is defined through the COO/CSR matrix + // 'inner_boundary_circle_matrix_' due to the across-origin treatment. + // It isn't tridiagonal and thus it requires a more advanced solver. + // Note that circle_tridiagonal_solver_[0] is thus unused! + // Additionally 'circle_tridiagonal_solver_[index]' will refer to the circular line i_r = index and + // 'radial_tridiagonal_solver_[index] will refer to the radial line i_theta = index. +#ifdef GMGPOLAR_USE_MUMPS + SparseMatrixCOO inner_boundary_circle_matrix_; + DMUMPS_STRUC_C inner_boundary_mumps_solver_; +#else + SparseMatrixCSR inner_boundary_circle_matrix_; + SparseLUSolver inner_boundary_lu_solver_; +#endif + std::vector> circle_tridiagonal_solver_; + std::vector> radial_tridiagonal_solver_; + + // clang-format off + const Stencil stencil_DB_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + /* Circle Stencils */ + const Stencil circle_stencil_interior_ = { + -1, 2, -1, + -1, 0, -1, + -1, 1, -1 + }; + const Stencil circle_stencil_across_origin_ = { + -1, 3, -1, + 1, 0, -1, + -1, 2, -1 + }; + /* Radial Stencils */ + const Stencil radial_stencil_interior_ = { + -1, -1, -1, + 1, 0, 2, + -1, -1, -1 + }; + const Stencil radial_stencil_next_outer_DB_ = { + -1, -1, -1, + 1, 0, -1, + -1, -1, -1 + }; + const Stencil radial_stencil_next_circular_smoothing_ = { + -1, -1, -1, + -1, 0, 1, + -1, -1, -1 + }; + // clang-format on + + const Stencil& getStencil(int i_r) const; + int getNonZeroCountCircleAsc(const int i_r) const; + int getNonZeroCountRadialAsc(const int i_theta) const; + + int getCircleAscIndex(const int i_r, const int i_theta) const; + int getRadialAscIndex(const int i_r, const int i_theta) const; + + void buildAscMatrices(); + void buildAscCircleSection(const int i_r); + void buildAscRadialSection(const int i_theta); + + void applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + void applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + + void solveCircleSection(const int i_r, Vector& x, Vector& temp, Vector& solver_storage_1, + Vector& solver_storage_2); + void solveRadialSection(const int i_theta, Vector& x, Vector& temp, Vector& solver_storage); + +#ifdef GMGPOLAR_USE_MUMPS + void initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix); + void finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver); +#endif +}; diff --git a/include/Smoother/SmootherTake/smootherTake.h b/include/Smoother/SmootherTake/smootherTake.h new file mode 100644 index 00000000..3f62df3b --- /dev/null +++ b/include/Smoother/SmootherTake/smootherTake.h @@ -0,0 +1,96 @@ +#pragma once + +#include "../smoother.h" + +#ifdef GMGPOLAR_USE_MUMPS + #include "dmumps_c.h" + #include "mpi.h" +#endif + +class SmootherTake : public Smoother +{ +public: + explicit SmootherTake(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + ~SmootherTake() override; + + void smoothing(Vector& x, const Vector& rhs, Vector& temp) override; + +private: + // The A_sc matrix on i_r = 0 is defined through the COO/CSR matrix + // 'inner_boundary_circle_matrix_' due to the across-origin treatment. + // It isn't tridiagonal and thus it requires a more advanced solver. + // Note that circle_tridiagonal_solver_[0] is thus unused! + // Additionally 'circle_tridiagonal_solver_[index]' will refer to the circular line i_r = index and + // 'radial_tridiagonal_solver_[index] will refer to the radial line i_theta = index. +#ifdef GMGPOLAR_USE_MUMPS + SparseMatrixCOO inner_boundary_circle_matrix_; + DMUMPS_STRUC_C inner_boundary_mumps_solver_; +#else + SparseMatrixCSR inner_boundary_circle_matrix_; + SparseLUSolver inner_boundary_lu_solver_; +#endif + std::vector> circle_tridiagonal_solver_; + std::vector> radial_tridiagonal_solver_; + + // clang-format off + const Stencil stencil_DB_ = { + -1, -1, -1, + -1, 0, -1, + -1, -1, -1 + }; + /* Circle Stencils */ + const Stencil circle_stencil_interior_ = { + -1, 2, -1, + -1, 0, -1, + -1, 1, -1 + }; + const Stencil circle_stencil_across_origin_ = { + -1, 3, -1, + 1, 0, -1, + -1, 2, -1 + }; + /* Radial Stencils */ + const Stencil radial_stencil_interior_ = { + -1, -1, -1, + 1, 0, 2, + -1, -1, -1 + }; + const Stencil radial_stencil_next_outer_DB_ = { + -1, -1, -1, + 1, 0, -1, + -1, -1, -1 + }; + const Stencil radial_stencil_next_circular_smoothing_ = { + -1, -1, -1, + -1, 0, 1, + -1, -1, -1 + }; + // clang-format on + + const Stencil& getStencil(int i_r) const; + int getNonZeroCountCircleAsc(const int i_r) const; + int getNonZeroCountRadialAsc(const int i_theta) const; + + int getCircleAscIndex(const int i_r, const int i_theta) const; + int getRadialAscIndex(const int i_r, const int i_theta) const; + + void buildAscMatrices(); + void buildAscCircleSection(const int i_r); + void buildAscRadialSection(const int i_theta); + + void applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + void applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, const Vector& x, + const Vector& rhs, Vector& temp); + + void solveCircleSection(const int i_r, Vector& x, Vector& temp, Vector& solver_storage_1, + Vector& solver_storage_2); + void solveRadialSection(const int i_theta, Vector& x, Vector& temp, Vector& solver_storage); + +#ifdef GMGPOLAR_USE_MUMPS + void initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix); + void finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver); +#endif +}; diff --git a/include/Smoother/smoother.h b/include/Smoother/smoother.h new file mode 100644 index 00000000..b43362db --- /dev/null +++ b/include/Smoother/smoother.h @@ -0,0 +1,42 @@ +#pragma once + +class LevelCache; +class Level; + +#include +#include +#include + +#include "../InputFunctions/boundaryConditions.h" +#include "../InputFunctions/densityProfileCoefficients.h" +#include "../InputFunctions/domainGeometry.h" +#include "../InputFunctions/sourceTerm.h" +#include "../Level/level.h" +#include "../LinearAlgebra/coo_matrix.h" +#include "../LinearAlgebra/csr_matrix.h" +#include "../LinearAlgebra/sparseLUSolver.h" +#include "../LinearAlgebra/symmetricTridiagonalSolver.h" +#include "../LinearAlgebra/vector.h" +#include "../LinearAlgebra/vector_operations.h" +#include "../PolarGrid/polargrid.h" +#include "../Stencil/stencil.h" +#include "../common/global_definitions.h" + +class Smoother +{ +public: + explicit Smoother(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads); + virtual ~Smoother() = default; + + virtual void smoothing(Vector& x, const Vector& rhs, Vector& temp) = 0; + +protected: + const PolarGrid& grid_; + const LevelCache& level_cache_; + const DomainGeometry& domain_geometry_; + const DensityProfileCoefficients& density_profile_coefficients_; + const bool DirBC_Interior_; + const int num_omp_threads_; +}; diff --git a/include/Stencil/stencil.h b/include/Stencil/stencil.h new file mode 100644 index 00000000..d1c65817 --- /dev/null +++ b/include/Stencil/stencil.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include + +enum class StencilPosition +{ + TopLeft, + Top, + TopRight, + Left, + Center, + Right, + BottomLeft, + Bottom, + BottomRight, +}; + +/** + * @brief Represents a stencil pattern used in sparse matrix construction + * (see p. 44 table 4 of Julian Litz Master Thesis) + * + * The Stencil class helps define neighborhood structure of a grid node. + * It maps each `StencilPosition` to an integer index that represents its + * inclusion in the stencil pattern. + * + * Non-zero indices are obtained via `ptr + offset`, where: + * - The Stencil class stores the offset for each position. + * - A value of `-1` means the position is not included in the stencil pattern. + * - Other values (0, 1, 2, ..., stencil_size - 1) correspond to valid stencil indices. + */ +class Stencil +{ +public: + Stencil(std::initializer_list init); + int operator[](StencilPosition type) const; + +private: + std::array values_; + int stencil_size_; +}; diff --git a/include/cmdline.h b/include/Utilities/cmdline.h old mode 100644 new mode 100755 similarity index 100% rename from include/cmdline.h rename to include/Utilities/cmdline.h diff --git a/include/common/equals.h b/include/common/equals.h new file mode 100644 index 00000000..24fe37e9 --- /dev/null +++ b/include/common/equals.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include +#include + +template +inline std::enable_if_t, bool> equals(T lhs, T rhs) +{ + return std::abs(lhs - rhs) <= + (1e3 * std::numeric_limits::epsilon()) * std::max(1.0, std::max(std::abs(lhs), std::abs(rhs))); +} \ No newline at end of file diff --git a/include/common/geometry_helper.h b/include/common/geometry_helper.h new file mode 100644 index 00000000..66f9dcf7 --- /dev/null +++ b/include/common/geometry_helper.h @@ -0,0 +1,34 @@ + +#pragma once + +#include "../InputFunctions/domainGeometry.h" + +#include + +inline void compute_jacobian_elements(const DomainGeometry& domain_geometry, const double& r, const double& theta, + const double& sin_theta, const double& cos_theta, const double& coeff_alpha, + double& arr, double& att, double& art, double& detDF) +{ + /* Calculate the elements of the Jacobian matrix for the transformation mapping */ + /* The Jacobian matrix is: */ + /* [Jrr, Jrt] */ + /* [Jtr, Jtt] */ + const double Jrr = domain_geometry.dFx_dr(r, theta, sin_theta, cos_theta); + const double Jtr = domain_geometry.dFy_dr(r, theta, sin_theta, cos_theta); + const double Jrt = domain_geometry.dFx_dt(r, theta, sin_theta, cos_theta); + const double Jtt = domain_geometry.dFy_dt(r, theta, sin_theta, cos_theta); + /* Compute the determinant of the Jacobian matrix */ + detDF = Jrr * Jtt - Jrt * Jtr; + /* Compute the elements of the symmetric matrix: */ + /* 0.5 * alpha * DF^{-1} * DF^{-T} * |det(DF)| */ + /* which is represented by: */ + /* [arr, 0.5*art] */ + /* [0.5*atr, att] */ + arr = 0.5 * (Jtt * Jtt + Jrt * Jrt) * coeff_alpha / fabs(detDF); + att = 0.5 * (Jtr * Jtr + Jrr * Jrr) * coeff_alpha / fabs(detDF); + art = (-Jtt * Jtr - Jrt * Jrr) * coeff_alpha / fabs(detDF); + /* Note that the inverse Jacobian matrix DF^{-1} is: */ + /* 1.0 / det(DF) * */ + /* [Jtt, -Jrt] */ + /* [-Jtr, Jrr] */ +} diff --git a/include/common/global_definitions.h b/include/common/global_definitions.h new file mode 100644 index 00000000..bef73fe9 --- /dev/null +++ b/include/common/global_definitions.h @@ -0,0 +1,151 @@ +#pragma once + +/* ---------------------------------- */ +/* GMGPolar - Enumeration Definitions */ +/* ---------------------------------- */ + +enum class StencilDistributionMethod +{ + CPU_TAKE = 0, + CPU_GIVE = 1 +}; + +/* Multigrid Cycle Types */ +enum class MultigridCycleType +{ + V_CYCLE = 0, + W_CYCLE = 1, + F_CYCLE = 2 +}; + +/* Residual Norm Type */ +enum class ResidualNormType +{ + EUCLIDEAN = 0, // Corresponds to the L2 norm + WEIGHTED_EUCLIDEAN = 1, // Scaled L2 norm (sqrt(u^T * u / DoFs)) + INFINITY_NORM = 2 // Corresponds to the L∞ norm +}; + +enum class ExtrapolationType +{ + NONE = 0, + IMPLICIT_EXTRAPOLATION = 1, + IMPLICIT_FULL_GRID_SMOOTHING = 2, + COMBINED = 3, +}; + +/* Smoother Colors */ +enum class SmootherColor +{ + Black = 0, + White = 1, +}; + +/* -----------*/ +/* Test Cases */ +/* -----------*/ + +/* Geometry Types - domain_geometry */ +enum class GeometryType +{ + CIRCULAR = 0, + SHAFRANOV = 1, + CZARNY = 2, + CULHAM = 3 +}; + +/* Test Problem Types - exact_solution */ +enum class ProblemType +{ + CARTESIAN_R2 = 0, + CARTESIAN_R6 = 1, + POLAR_R6 = 2, + REFINED_RADIUS = 3 +}; + +/* Alpha Coefficient Types - profile_coefficient alpha */ +enum class AlphaCoeff +{ + POISSON = 0, + SONNENDRUCKER = 1, + ZONI = 2, + ZONI_SHIFTED = 3 +}; + +/* Beta Coefficient Types - profile_coefficient beta */ +enum class BetaCoeff +{ + ZERO = 0, + ALPHA_INVERSE = 1 +}; + +/* ---------------------------- */ +/* Mumps - Constant Definitions */ +/* ---------------------------- */ +#ifdef GMGPOLAR_USE_MUMPS + /* Mumps macro s.t. indices match documentation */ + #define ICNTL(I) icntl[(I) - 1] + #define CNTL(I) cntl[(I) - 1] + #define INFOG(I) infog[(I) - 1] + + #define USE_COMM_WORLD -987654 + #define PAR_NOT_PARALLEL 0 + #define PAR_PARALLEL 1 + + #define JOB_INIT -1 + #define JOB_END -2 + #define JOB_REMOVE_SAVED_DATA -3 + #define JOB_FREE_INTERNAL_DATA -4 + #define JOB_SUPPRESS_OOC_FILES -200 + + #define JOB_ANALYSIS_PHASE 1 + #define JOB_FACTORIZATION_PHASE 2 + #define JOB_COMPUTE_SOLUTION 3 + #define JOB_ANALYSIS_AND_FACTORIZATION 4 + #define JOB_FACTORIZATION_AND_SOLUTION 5 + #define JOB_ANALYSIS_FACTORIZATION_SOLUTION 6 + #define JOB_SAVE_INTERNAL_DATA 7 + #define JOB_RESTORE_INTERNAL_DATA 8 + #define JOB_DISTRIBUTE_RHS 9 + + #define SYM_UNSYMMETRIC 0 + #define SYM_POSITIVE_DEFINITE 1 + #define SYM_GENERAL_SYMMETRIC 2 +#endif + +// --------------------------------------- // +// Function-like macros for LIKWID markers // +// --------------------------------------- // + +#ifdef GMGPOLAR_USE_LIKWID + #include + #include + + #define LIKWID_INIT() LIKWID_MARKER_INIT + + #define LIKWID_REGISTER(marker) \ + _Pragma("omp parallel") \ + { \ + LIKWID_MARKER_REGISTER(marker); \ + } + + #define LIKWID_START(marker) \ + _Pragma("omp parallel") \ + { \ + LIKWID_MARKER_START(marker); \ + } + + #define LIKWID_STOP(marker) \ + _Pragma("omp parallel") \ + { \ + LIKWID_MARKER_STOP(marker); \ + } + + #define LIKWID_CLOSE() LIKWID_MARKER_CLOSE +#else + #define LIKWID_INIT() + #define LIKWID_REGISTER(marker) + #define LIKWID_START(marker) + #define LIKWID_STOP(marker) + #define LIKWID_CLOSE() +#endif \ No newline at end of file diff --git a/include/common/space_dimension.h b/include/common/space_dimension.h new file mode 100644 index 00000000..9ba369e1 --- /dev/null +++ b/include/common/space_dimension.h @@ -0,0 +1,3 @@ +#pragma once + +constexpr inline int space_dimension = 2; \ No newline at end of file diff --git a/include/config.h b/include/config.h deleted file mode 100644 index ea43a7d3..00000000 --- a/include/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Martin J. Kühn -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** - * Configuration of GMGPolar library. - */ - -#ifndef GMGPOLAR_CONFIG_H -#define GMGPOLAR_CONFIG_H - -#include "config_internal.h" - -#endif // GMGPOLAR_CONFIG_H diff --git a/include/config_internal.h b/include/config_internal.h deleted file mode 100644 index 38e6a59d..00000000 --- a/include/config_internal.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Martin J. Kühn -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** - * Configured by cmake. - */ - -#ifndef GMGPOLAR_CONFIG_INTERNAL_H -#define GMGPOLAR_CONFIG_INTERNAL_H - -#define GMGPOLAR_USE_MUMPS - -#endif // GMGPOLAR_CONFIG_INTERNAL_H diff --git a/include/config_internal.h.in b/include/config_internal.h.in deleted file mode 100644 index 3bf582e8..00000000 --- a/include/config_internal.h.in +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Martin J. Kühn -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/** - * Configured by cmake. - */ - -#ifndef GMGPOLAR_CONFIG_INTERNAL_H -#define GMGPOLAR_CONFIG_INTERNAL_H - -#cmakedefine GMGPOLAR_USE_MUMPS -#cmakedefine GMGPOLAR_USE_LIKWID - -#endif // GMGPOLAR_CONFIG_INTERNAL_H diff --git a/include/constants.h b/include/constants.h deleted file mode 100644 index 8083cce2..00000000 --- a/include/constants.h +++ /dev/null @@ -1,382 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file constants.h - * \brief Header defining constants and enumerations of Controls/Info - * \author M. Kuehn, C. Kruse, P. Leleux - * \version 0.0 - */ -#ifndef CONSTANTS_HXX_ -#define CONSTANTS_HXX_ - -#include - -/// Defines the control parameters indices in a safe way -namespace Param -{ -//! To be used with the gyro::icntl vector. -enum icontrols -{ - /*! \brief (WIP) Optimized code - * - * 0: old version (non-optimized version for validation in the beginning, not maintained for some time; do not use) - * 1: new version (default) - */ - optimized, - /*! \brief Verbose level - * - * Defines the level of verbose outputs. For higher levels all output from lower levels is always given. - * 0: No output - * 1: Minimal convergence output. - * 2: Minimal problem setting details, iteration output and timings. - * 3: Print all parameters and more detailed problem settings. - * 4: Information on called functions. - * 5: Prints information on multigrid levels. - * 6: Print out all kind of variable values. - */ - verbose, - /*! \brief openmp paralellization - * - * Defines the number of threads we use - */ - openmp, - /*! \brief Matrix-free implementation - * - * Defines if a matrix free implementation is used - * (A is applied) or not (A is assembled) - */ - matrix_free, - /*! \brief Check the implementation - * - * Compare the results of the current implementation with - * structures extracted from the MATLAB implementation. - * Only the setup is run, no multigrid cycle. - */ - debug, - /*! \brief Number of nodes (exponents) - * - * Defines the number of nodes in each direction: - * - nr = 2^(nr_exp-1) - * - ntheta = 2^(ceil(log2(nr))-1) - * - * More detailed: - * - * First, the number of nodes in r-direction is computed as follows: - * without any ansisotropy (fac_ani=0), we have nr=2^(nr_exp - 1) equally distributed nodes; - * with anisotropy: we fisrt create nr=2^(nr_exp) - 1^(fac_ani) equally distributed nodes, and then, the grid is refined fac_ani-times; - * Lastly, regardless of using any anisotropy or not, we refine again by splitting all intervals at the midpoint - * (to obtain a uniform grid refinement between the two finest levels for a successful extrapolation). - * - * Second, the number of nodes in theta-direction is computed as follows: - * ntheta= 2^(ceil(log_2(nr))) - * - */ - nr_exp, - /*! \brief The parameter ntheta_exp is not used in our simulations. We generally define the number of theta intervals similar to the number of intervals in r. - */ - ntheta_exp, - /*! \brief Anisotropic discretization in 'edge' region for r - * - * Defines if we use anisotropic discretization in r-direction - * - * Possible values are: - * - -1: input list of r and theta coordinates - * - 0: no anisotropy - * - >0: anisotropy (automatic) (number of refinements) - * - */ - fac_ani, - /*! \brief Not used - * (we never have an ansisotropy in theta-direction, so the value is always 0/false) - */ - theta_aniso, - /*! \brief Smoothing steps - * - * Number of pre- (v1) and post- (v2) -smoothing steps - */ - v1, - v2, - /*! \brief Type of MG cycle - * - * Type of multigrid cycle: - * - 1: V-cycle (default setting) - * - 2: W-cycle - */ - cycle, - /*! \brief Defines the form of the considered cross-section: Circular or stretched geometry. If `mod_pk=0`, we consider a circular geometry. If `mod_pk>1`, it always goes with a particular choice of `kappa_eps` and `delta_e` to describe realistic Tokamak cross sections. - - For more details, we refer to: - - Bouzat, N., Bressan, C., Grandgirard, V., Latu, G., Mehrenberger, M.: Targeting Realistic Geometry in Tokamak Code Gysela. (2018) - - Zoni, E., Güçlü, Y.: Solving hyperbolic-elliptic problems on singular mapped disk-like -domains with the method of characteristics and spline finite elements. (2019) - - Bourne et al.: Solver comparison for Poisson-like equations on tokamak geometries. (2023) - * - * Defines the shape of the geometry: - * - 0: kappa_eps = delta_e = 0 (circular geometry) - * - 1: kappa_eps=0.3, delta_e=0.2 (stretched and deformed circle, also denoted Shafranov geometry) - * - 2: kappa_eps=0.3, delta_e=1.4 (stretched and deformed circle, also denoted Czarny geometry) - */ - mod_pk, - /*! \brief Compute rho - * - * Defines if we compute rho, i.e. the reduction factor for the - * residual through the iteration. - */ - compute_rho, - /*! \brief Maximum level for MG - * - * Defines the maximum level used for the multigrid scheme: - * -1: limit such that there are 3 points in r, and 4 points in theta on the finest grid. - */ - level, - /*! \brief Plot or not - * - * Plot or not - */ - plotit, - /*! \brief Compare with exact solution - * - * Compute the the exact solution without MG for comparison - * (ok with manufactured solutions). - */ - solveit, - /*! \brief Maximum iterations for MG - * - * Maximum number of iterations for the multigrid scheme. - */ - maxiter, - /*! \brief Periodic boundary condition in theta - * - * Periodic boundary condition in theta. The other possibility was - * Dirichlet BC but we do not consider this anymore. - */ - periodic, - /*! \brief Specifies if theta has a periodicity condition - * - * Specifies if theta has a periodicity condition - */ - origin_NOT_coarse, - /*! \brief Smoother (3 and 13 only) - * - * Defines the smoother we use: - * - 0: PointRB (not implemented) - * - 1: CircZGS (not implemented) - * - 2: RadZGS (not implemented) - * - 3: AltZGS (coupled circle-radial version) (default setting) - * - 13: Decoupled AltZGS (C-R: BJ, W-B: GS) (faster to execute but leads to more iterations) - * - 4: optimizedAltZGS (not implemented) - * - 5: MixZGS (not implemented) - */ - smoother, - /*! \brief Discretization scheme (3 only) - * - * Defines the discretization scheme we use - * 0: FD (useless) - * 1: 5p (not implemented) - * 2: 7p (not implemented) - * 3: 9p - * 4: P1 (not implemented) - * 5: P1nonst (not implemented) - * 6: P2 (not implemented) - */ - discr, - /*! \brief Extrapolation - * - * 0: no extrapolation - * 1: implicit extrapolation with adapted smoothing on finest grid (default setting) - * 2: experimental version of implicit extrapolation with full grid smoothing (residual stopping criterion not functional, use with care) - * 3: extrap_integer (FE only) - * 4: no_extrap_integr (FE only) - */ - extrapolation, - /*! \brief Boundary conditions on the interior circle - * - * - 0: Across the origin - * - 1: Dirichlet - */ - DirBC_Interior, - /*! \brief Output paraview file - * - * Output paraview file for visualization - */ - paraview, - /*! \brief Divide the intervals of the grid by 2^(divideBy2) - * - * Divides the intervals of the grid by 2^(divideBy2) - * (defines how often to split the intervals of the grid at the midpoint) - */ - divideBy2, - /*! \brief Problem to solve - * - * Defines the problem to solve - * - 5: the classical problem (Zoni2019, aligned with the cartesian grid) - * - 6: more realistic problem (Emily & Virginie, aligned with the polar grid) - */ - prob, - /*! \brief Coefficient alpha - * - * Defines the coefficient alpha - * 0: arctan coeff (Sonnendrucker2019, private communication) - * 1: tanh coeff (Zoni2019) - * 2: tanh coeff (Zoni2019 with steeper and shifted jump) - */ - alpha_coeff, - /*! \brief Coefficient beta - * - * Defines the coefficient - * 0: beta = 0 - * 1: beta: 1/alpha for some cases, different in others (see coeffs in test_cases) - */ - beta_coeff, - /*! \brief Norm for stopping criterion - * Defines the norm used for the residual in the stopping criterion - * 0: L2 norm scaled by initial res. - * 1: Infinitiy norm scaled by initial res. - * 2: L2 norm - * 3: Infinitiy norm - */ - res_norm, - /*! \brief Read or write radii/angles files - * When f_grid_r/f_grid_theta not empty, - * 0: read radii/angles file for the grid. - * 1: write radii/angles file after creating the grid. - */ - write_radii_angles, - /*! \brief Check the error - * Compute the error w.r.t. the theoretical solution - * 0: do note check - * 1: check. If the parameter "sol_in" is given, the error is computed w.r.t. a solution read from a file. - */ - check_error, -}; -//! To be used with the gyro::dcntl vector. -enum dcontrols -{ - /*! \brief Radius of the disk - * - * Interior (R0) and exterior (R) radius of the disk-like shape - */ - r0_DB, - R0, - R, - /*! \brief angles inside the disk - * - * Start/end angle for the disk-like shape discretization - */ - THETA0, - THETA, - /*! \brief Parameters of the grid - * - * Defines the shape of the geometry: - * - if mod_pk = 0: circular geometry - * [x=r.cos(theta), y=r.sin(theta)] - * - elif mod_pk=1: stretched circular geometry (Shafranov geometry) - * [x=(1-kappa_eps)r*cos(theta)-delta_e*r^2, y=(1+kappa_eps)r*sin(theta)] - * - elif mod_pk=2: stretched circular geometry (Czarny geometry) - * [x=1/kappa_eps ( 1 - sqrt{1 + kappa_eps ( kappa_eps + 2r*cos(theta) )} ), y=y_0 + (delta_e \xi r sin(theta)) / (1 + kappa_eps x(r, theta))] - * [For more details, we refer to Bourne et al. (2023).] - * with - * - kappa_eps: Elongation (For the Shafranov geometry, the parameter is denoted kappa, for the Czarny geometry, it is epsilon. - * - delta_e: Shafranov shift (outward radial - * displacement of the centre of flux) (For the Shafranov geometry, this parameter is denoted delta, for the Czarny geometry, it is e.) - */ - kappa_eps, - delta_e, - /*! \brief Distance to boundary - * - * Defines the distance below which nodes are considered part of the boundary. - */ - tol_bound_check, - /*! \brief Threshold for convergence - * - * Threshold for convergence with stopping criterion: - * - scaled residual for extrapolation < 2 - * - evolution of error w.r.t. theoretical solution for extrapolation 2 - */ - rel_red_conv, - /*! \brief Timings - */ - t_arr_art_att, // Evaluation of arr, art, and att - t_coeff, // Evaluation of alpha and beta (subcounter of t_arr_art_att) - t_sol, - t_detDFinv, - t_trafo, -}; -//! To be used with the gyro::info vector. -enum info -{ -}; -//! To be used with the gyro::dinfo vector. -enum dinfo -{ -}; -//! Stencils are represented by vectors with: -// - -1: not in the stencil -// - n: position of the entry w.r.t other entries of the same node -enum stencil -{ - bottom_left, - bottom, - bottom_right, - left, - middle, - right, - top_left, - top, - top_right, -}; -} // namespace Param - -//const double PI = 3.141592653589793238463; -const double PI = M_PI; - -// See Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -// used as Param::mod_pk ("modified polar coordinates") in GMGPolar -enum geometry_type -{ - CIRCULAR = 0, // simple circular domain - SHAFRANOV = 1, // Fig. 6a - TRIANGULAR = 2, // Fig. 6b (also denoted Czarny) - CULHAM = 3 // Fig. 18 -}; - -enum alpha_val -{ - SONNENDRUCKER = 0, - ZONI = 1, - ZONI_SHIFTED = 2, - POISSON = 3, -}; - -// Defines the manufactured solution to compare the computed error against. -// see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1 -// or Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -enum problem_type -{ - FLAT = 1, - REFINED_RADIUS = 4, - CARTESIAN_R2 = 5, // - POLAR_R6 = 6, // Bourne et al., Eq. (22) - CARTESIAN_R6 = 7, // Bourne et al., Eq. (23) -}; -#endif // CONSTANTS_HXX diff --git a/include/exact_funcs.h b/include/exact_funcs.h deleted file mode 100644 index 9c27c943..00000000 --- a/include/exact_funcs.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -#pragma once - -class ExactFuncs -{ -public: - virtual ~ExactFuncs() - { - } - virtual double x(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void x(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void x(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const = 0; - virtual double y(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void y(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void y(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const = 0; - virtual double J_rr(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void J_rr(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void J_rr(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; - virtual double J_rt(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void J_rt(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void J_rt(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; - virtual double J_tr(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void J_tr(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void J_tr(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; - virtual double J_tt(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void J_tt(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void J_tt(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; - virtual double rho_glob(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void rho_glob(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void rho_glob(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; - virtual double rho_pole(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void rho_pole(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void rho_pole(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; - virtual double coeffs1(double r, double Rmax) const = 0; - virtual void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const = 0; - virtual double coeffs2(double r, double Rmax) const = 0; - virtual void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const = 0; - virtual double phi_exact(double r, double theta, double kappa_eps, double delta_e, double Rmax) const = 0; - virtual void phi_exact(std::vector const& r, double theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol) const = 0; - virtual void phi_exact(double r, std::vector const& theta, double kappa_eps, double delta_e, double Rmax, - std::vector& sol, std::vector& sin_theta, - std::vector& cos_theta) const = 0; -}; diff --git a/include/gmgpolar.h b/include/gmgpolar.h deleted file mode 100644 index 50e3cc1d..00000000 --- a/include/gmgpolar.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// The class for the multigrid gmgpolar where each level is from class level - -/*! - * \file gmgpolar.h - * \brief Header for the class gmgpolar - * \author M. Kuehn, C. Kruse, P. Leleux - * \version 0.0 - */ -#ifndef GMGPOLAR_HXX_ -#define GMGPOLAR_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "config.h" -#include "constants.h" -#include "level.h" -#include "gyro.h" -#ifdef GMGPOLAR_USE_LIKWID -#include -#endif - -class gmgpolar -{ -public: - /******************************************************************************* - * Attributes - ******************************************************************************/ - /*************************************************************************** - * Grid levels - **************************************************************************/ - /*! Vector of levels for the MG scheme (geometry, operators, etc.) */ - int levels, levels_orig; // Number of levels - std::vector v_level; - - /*************************************************************************** - * Multigrid scheme - **************************************************************************/ - std::vector nrm_2_res; - std::vector nrm_2_err; - std::vector nrm_inf_res; - - /* execution times */ - // Setup - double t_setup; // prepare_op_levels - // Subcounters of Setup - double t_build; // build A and RHS - double t_facto_Ac; // factorization of coarse operator - double t_build_P; // build coarse nodes, line splitting and P - double t_build_Asc; // build Asc and Asc_ortho - double t_facto_Asc; // factorization of Asc - // Multigrid cycle - double t_total_mgcycle; // multigrid_cycle_extrapol - // Subcounter of Multigrid cycle - double t_smoothing; // pre- and post-smoothing (including solve Asc) - double t_residual; // computation of the residual - double t_restriction; // restriction - double t_Ac; // solve coarse operator - double t_prolongation; // prolongation and coarse grid correction - - double t_fine_residual; // computation of residual on level 0 (init and after iteration) - double t_error; // computation of final error - double t_applyA; // apply the operator A, method apply_A - - /******************************************************************************* - * Methods - ******************************************************************************/ - gmgpolar(); - ~gmgpolar(); - - void reset_timers(); - void create_grid_polar(); - void create_grid_polar_divide(); - void polar_multigrid(); - void check_geom(); - void define_coarse_nodes(); - void prepare_op_levels(); - void debug(); - void multigrid_iter(); - void multigrid_cycle_extrapol(int l); - void compute_residual(int l, int extrapol); - std::vector compute_error(); - double compute_backwarderror(); - -private: -/******************************************************************************* -* Attributes -******************************************************************************/ - -/******************************************************************************* -* Methods -******************************************************************************/ -}; - -#endif // GMGPOLAR_HXX diff --git a/include/gyro.h b/include/gyro.h deleted file mode 100644 index e6e39608..00000000 --- a/include/gyro.h +++ /dev/null @@ -1,220 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// The class for all util fonctions and parameters including -// - parameters -// - the dirichlet boundary conditions -// - trafo functions - -/*! - * \file gyro.h - * \brief Header for the class gyro - * \author M. Kuehn, C. Kruse, P. Leleux - * \version 0.0 - */ -#ifndef GYRO_HXX_ -#define GYRO_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "constants.h" -#include "exact_funcs.h" - -// #define TIC t = clock() -// #define TOC ((double)(clock() - t)) / CLOCKS_PER_SEC -#define TIC t = omp_get_wtime() -#define TOC (omp_get_wtime() - t) - -namespace gyro -{ -// /******************************************************************************* -// * Timings -// ******************************************************************************/ -// extern double t_coeff; // compute coeff alpha -// extern double t_arr_art_att; // compute arr/art/Att -// extern double t_sol; // compute the exact solution (for Dirichlet, RHS, and error) -// extern double t_detDFinv; // compute the inverse of the determinant from the mapping of curvilinear coordinates -// extern double t_trafo; // compute transformation cartesian-curvilinear - -/******************************************************************************* - * Attributes - ******************************************************************************/ -/*************************************************************************** -* Controls and Informations -**************************************************************************/ -/*! The integer control array, see Controls::icontrols for the - * possible values - */ -extern std::vector icntl; - -/*! The real control array, see Controls::dcontrols for the - * possible values - */ -extern std::vector dcntl; - -/*! The integer info output array, see Controls::info */ -extern std::vector info; -/*! The real info output array, see Controls::dinfo */ -extern std::vector dinfo; -/*! The exact functions for the configuration*/ -extern std::unique_ptr functions; - -/* File names containing the grid - * Comma separated list of radii - */ -extern std::string f_grid_r, f_grid_theta; - -/* File name containing the solution as input - * 1 value per line - */ -extern std::string f_sol_in, f_sol_out; - -/******************************************************************************* - * Methods - ******************************************************************************/ -/*************************************************************************** -* Parameters -**************************************************************************/ -void init_params(); -void show_params(); -void get_geometry_coeffs(geometry_type geom); -void select_functions_class(int alpha_coeff, int beta_coeff, int geom, int prob); - -/*************************************************************************** -* Boundary and solution -**************************************************************************/ -/************************ - * Single - ************************/ -double distBoundary(double x, double y, int verbose); -double eval_def_rhs(double r, double theta, int verbose); -int sign(double n); -double def_solution_rt(double r, double t, int verbose); -/************************ - * Vector - ************************/ -std::vector eval_def_rhs(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose); -std::vector def_solution_rt(double r_i, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose); - -/*************************************************************************** -* Diffusivity and operator -**************************************************************************/ -/************************ - * Single - ************************/ -double coeff_alpha(double r, int verbose); -double coeff_beta(double r, int verbose); -double detDFinv(double r, double theta, int verbose); -double arr(double r, double theta, int verbose); -double art(double r, double theta, int verbose); -double att(double r, double theta, int verbose); -void arr_att_art(double r, double theta, double& arr, double& att, double& art, int verbose); -/************************ - * Vector - ************************/ -std::vector coeff_alpha(std::vector r, int verbose); -std::vector coeff_beta(std::vector r, int verbose); -std::vector detDFinv(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose); -std::vector detDFinv(std::vector r, double theta, int verbose); -std::vector arr(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose); -std::vector art(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose); -std::vector att(double r, std::vector theta, std::vector cos_theta, - std::vector sin_theta, int ntheta, int verbose); -void arr_att_art(double r, std::vector theta, std::vector cos_theta, std::vector sin_theta, - int ntheta, std::vector& arr, std::vector& att, std::vector& art, int verbose); -void arr_att_art(std::vector r, double theta, std::vector& arr, std::vector& att, - std::vector& art, int verbose); - -/*************************************************************************** -* Polar to cartesian and back -**************************************************************************/ -/************************ - * Single - ************************/ -void trafo(double& r_i, double& theta_j, double& x, double& y, int verbose); -void trafo_back(double& r_i, double& theta_j, double& x, double& y, int verbose); -/************************ - * Vector - ************************/ -void trafo(double r_i, std::vector theta, std::vector sin_theta, std::vector cos_theta, - int ntheta, std::vector& x, std::vector& y, int verbose); - -/*************************************************************************** -* Display arrays or vectors -**************************************************************************/ -/*! - * \brief Forwards all values inside an array to std::cout. - * - * \param na: Size of the array. - * \param a: The array. - * \param s_a: Name of the array (to be printed). - * - */ -template -void disp(int na, T* a, const std::string& s_a) -{ - std::cout << s_a << "(" << na << "): "; - for (int i = 0; i < na; i++) - std::cout << a[i] << " "; - std::cout << "\n"; -} - -/*! - * \brief Forwards all values inside a vector to std::cout. - * - * \param a: The vector. - * \param s_a: Name of the vector (to be printed). - * - */ -template -void disp(std::vector a, const std::string& s_a) -{ - std::cout << s_a << "(" << a.size() << "): "; - for (std::size_t i = 0; i < a.size(); i++) - std::cout << a[i] << " "; - std::cout << "\n"; -} - -/*************************************************************************** -* Matrix operations -**************************************************************************/ -void sp_dgemv(int trans, int m, int n, double alpha, std::vector row_indices, std::vector col_indices, - std::vector vals, int lda, std::vector x, int incx, double beta, std::vector& y, - int incy); -double norm(std::vector x); -double A_norm(std::vector x, int m, std::vector row_indices, std::vector col_indices, - std::vector vals); -} // namespace gyro - -#endif // GYRO_HXX_ diff --git a/include/level.h b/include/level.h deleted file mode 100644 index f8167002..00000000 --- a/include/level.h +++ /dev/null @@ -1,319 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// The class for a level in the gmgpolar, containing the disk-like shape -// geometry of the problem, the operator, etc. - -/*! - * \file level.h - * \brief Header for the class level - * \author M. Kuehn, C. Kruse, P. Leleux - * \version 0.0 - */ -#ifndef LEVEL_HXX_ -#define LEVEL_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" -#include "gyro.h" - -#ifdef GMGPOLAR_USE_MUMPS - #include "mpi.h" - #include "dmumps_c.h" - - #define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */ - #define CNTL(I) cntl[(I)-1] /* macro s.t. indices match documentation */ -#endif - -class level -{ -public: - /******************************************************************************* - * Attributes - ******************************************************************************/ - /*! the level (0=finest) */ - int l; - - /*! size of r and theta */ - int nr, ntheta; // Number of nodes - int ntheta_int, nr_int; // Number of intervals - - /* execution times */ - double t_smoothing, t_f_sc, t_Asc_ortho, t_Asc; - double t_get_ptr, t_get_stencil, t_get_smoother, t_get_row; - - /*! Coordinates in r and theta directions */ - std::vector r; - std::vector is_bound; - std::vector theta, thetaplus, hplus; - std::vector theta_per, thetaplus_per, cos_theta, sin_theta, cos_theta_per, sin_theta_per; - std::vector theta_PI, cos_theta_PI, sin_theta_PI; - - /*! Coarse nodes */ - int coarse_nodes; - std::vector coarse_nodes_list_r; - std::vector coarse_nodes_list_theta; - - /*! Operator */ - int m, nz; - std::vector row_indices, col_indices; - std::vector vals; - // Factorization of the coarse operator - // - using in-house solver - std::vector row_Ac_LU, col_Ac_LU; - std::vector vals_Ac_LU; -#ifdef GMGPOLAR_USE_MUMPS - // - using MUMPS - DMUMPS_STRUC_C mumps_Ac; - DMUMPS_STRUC_C mumps_across; -#endif - /*! Beta coefficient update */ - std::vector betaVec; - - /*! RHS */ - std::vector fVec; - std::vector fVec_initial; - - /*! Solution */ - std::vector sol_in; - - /*! Prolongation */ - int mc, nz_P, nz_P_inj, nz_P_ex; - std::vector ri_prol, ci_prol; - std::vector v_prol; - std::vector ri_prol_inj, ci_prol_inj; - std::vector v_prol_inj; - std::vector ri_prol_ex, ci_prol_ex; - std::vector v_prol_ex; - - /*! Smoother */ - int delete_circles; - std::vector zebra1, zebra2; - std::vector> coloring; - std::vector zebra_BnW; - // size and number of entries in Asc/sc_ortho - std::vector m_sc; - std::vector nz_sc; - std::vector nz_sc_ortho; - // Asc and Asc_ortho matrices stored in 6 2D vectors: - // - smoother(Circle-Radial) + color(Black/White) (array) - // - ij (vect) - // - row/col/val (vect) - std::vector> A_Zebra_r; - std::vector> A_Zebra_c; - std::vector> A_Zebra_v; - std::vector> A_Zebra_r_row[4]; - std::vector> A_Zebra_c_row[4]; - std::vector> A_Zebra_v_row[4]; - - // Number of blocks per smoother (and maximum unmber of block as 5th element) - std::vector nblocks; - std::vector> A_Zebra_Mix_r; - std::vector> A_Zebra_Mix_c; - std::vector> A_Zebra_Mix_v; - std::vector> A_Zebra_Mix_r_row[4]; - std::vector> A_Zebra_Mix_c_row[4]; - std::vector> A_Zebra_Mix_v_row[4]; - // Vectors necessary for the parallel application of Asc_ortho in multigrid_smoothing - std::vector shift_vect_s2, shift_vect_s3, ptr_vect_s2, ptr_vect_s3; - // Factorization of Asc - // - using in-house solver - std::vector> A_Zebra_r_LU; - std::vector> A_Zebra_c_LU; - std::vector> A_Zebra_v_LU; - std::vector> A_Zebra_r_LU_row[4]; - std::vector> A_Zebra_c_LU_row[4]; - std::vector> A_Zebra_v_LU_row[4]; -#ifdef GMGPOLAR_USE_MUMPS - // - using MUMPS - DMUMPS_STRUC_C mumps_A_Zebra[4]; - - std::vector mumps_A_Zebra_row[4]; -#endif - - /* Dependencies */ - // int *dep_Asc_ortho, *dep_Asc, *dep_u; - std::vector dep_Asc_ortho, dep_Asc; - std::vector size_Asc_ortho, size_Asc; - - /*! Solution */ - std::vector u; - // u from the previous smoothing procedure - // - for the circular smoother - std::vector u_previous_c; - // - for the radial smoother - std::vector u_previous_r; - std::vector res; // residual - - /******************************************************************************* - * Methods - ******************************************************************************/ - level(int l_); - ~level(); - void reset_timers(); - - /*************************************************************************** - * Geometry - **************************************************************************/ - void build_r(); - void read_grid_r(); - void write_grid_r(); - void build_theta(); - void read_grid_theta(); - void write_grid_theta(); - void display_r(); - void display_theta(); - - /*************************************************************************** - * gmgpolar - **************************************************************************/ - void define_coarse_nodes_onelevel(level* finer); - void store_theta_n_co(); - // void define_colors(); - void define_line_splitting(); - - /* System */ - // original versions (deprecated) - void build_A0(); - void apply_A0(std::vector u, std::vector& Au); - void build_rhs0(); - // optimized - void define_nz(); - int get_ptr(int i, int j); - std::vector get_ptr(int j); - std::vector get_stencil(int j); - void build_A(); - void apply_A(std::vector u, std::vector& Au); - void build_rhs(); - void build_betaVec(); - void read_sol(); - void write_sol(); - - /* Prolongator */ - // original versions (deprecated) - std::vector apply_prolongation_bi0(std::vector u, int mc, int ncoarse, std::vector coarse_r, - std::vector coarse_theta, int trans); - std::vector apply_prolongation_inj0(std::vector u, int mc, int ncoarse, std::vector coarse_r, - std::vector coarse_theta, int trans); - std::vector apply_prolongation_ex0(std::vector u, int mc, int ncoarse, std::vector coarse_r, - std::vector coarse_theta, int trans); - // optimized - void define_nz_P(); - void build_prolongation_bi(); - std::vector apply_prolongation_bi(std::vector u); - std::vector apply_restriction_bi(std::vector u); - void build_prolongation_inj(); - std::vector apply_prolongation_inj(std::vector u); - std::vector apply_restriction_inj(std::vector u); - void build_prolongation_ex(); - std::vector apply_prolongation_ex(std::vector u); - std::vector apply_restriction_ex(std::vector u); - - /* Smoothing */ - void multigrid_smoothing(int smoother, int v, std::vector& f_Asc_u, int nblocks, int c, int* dep_Asc_cur, - int* dep_Asc_prev, int* dep_Asc1, int* dep_Asc_ortho_cur); - // void build_fsc(std::vector& f_sc, int smoother); - // void build_fsc(std::vector& f_sc, std::vector& f, int smoother, int loc_to_glob); - void build_fsc(std::vector& f_sc, std::vector& f, int smoother, int loc_to_glob, int start, - int end); - // original versions (deprecated) - void multigrid_smoothing0(int smoother); - void build_fsc0(std::vector& f_sc, int smoother); - void build_Asc0(); - void apply_Asc_ortho0(std::vector& Au, int smoother); - // optimized - void define_m_nz_Asc(); - int define_nz_Asc_ij(int smoother, int ij, int ortho); - std::vector get_ptr_sc(int j, int smoother, int ortho); - int get_smoother(int i, int j); - std::vector get_smoother_circle(int i); - std::vector get_smoother_radial(int j); - std::vector get_stencil_sc(int j, int smoother, int ortho); - int get_row(int i, int j, int smoother, int extrapol); - int mapping_usc_to_u(int ind_sc, int smoother); - std::vector mapping_usc_to_u(int ind_sc_start, int ind_sc_end, int smoother); - std::vector get_row(int j, int smoother, int extrapol, int local, int col_wise); - std::vector get_row_i(int i, int size, int smoother, int extrapol); - std::vector get_row_i_glob(int i, int size, int smoother, int extrapol); - void build_Asc(); - void build_Asc_ortho(int smoother); - void apply_Asc_ortho(std::vector& Au, std::vector& u, int smoother, int v, int c, int* dep_Asc_cur, - int* dep_Asc_prev, int* dep_Asc1, int* dep_Asc_ortho_cur); - void apply_Asc_ortho2(std::vector& Au, std::vector u, int smoother); - void apply_Asc_ortho_ij(int _ij, std::vector& Au, std::vector u, int smoother_todo); - - /* Direct solver */ - // original versions (deprecated) - std::vector solve_gaussian_elimination_fb_subst(std::vector A_row_indices, - std::vector A_col_indices, std::vector A_vals, - std::vector f); - double get_element(std::vector A_row_indices, std::vector A_col_indices, std::vector A_vals, - int row_index, int col_index); - void set_element(std::vector& A_row_indices, std::vector& A_col_indices, std::vector& A_vals, - int row_index, int col_index, double value); - // optimized - void facto_gaussian_elimination(std::vector& A_row_indices, std::vector& A_col_indices, - std::vector& A_vals, int m_solution); - std::vector solve_gaussian_elimination(std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, std::vector f); -#ifdef GMGPOLAR_USE_MUMPS - void init_mumps(DMUMPS_STRUC_C& mumps); - void facto_mumps(DMUMPS_STRUC_C& mumps, std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, int m_solution); - std::vector solve_mumps(DMUMPS_STRUC_C& mumps, std::vector f); - void finalize_mumps(DMUMPS_STRUC_C& mumps); -#endif - // specialized - void fill_in_circle(int ij, int smoother); - std::vector solve_diag(std::vector A_vals, std::vector f); - void facto_circle(std::vector& A_row_indices, std::vector& A_col_indices, std::vector& A_vals, - int m_solution); - std::vector solve_circle(std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, std::vector f); - void facto_radial(std::vector& A_row_indices, std::vector& A_col_indices, std::vector& A_vals, - int m_solution); - std::vector solve_radial(std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, std::vector f); - -private: - /******************************************************************************* - * Attributes - ******************************************************************************/ - - /******************************************************************************* - * Methods - ******************************************************************************/ -}; - -#endif // LEVEL_HXX diff --git a/include/test_cases/CartesianR2GyroSonnendruckerCircular.h b/include/test_cases/CartesianR2GyroSonnendruckerCircular.h deleted file mode 100644 index c24669f5..00000000 --- a/include/test_cases/CartesianR2GyroSonnendruckerCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroSonnendruckerCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroSonnendruckerShafranov.h b/include/test_cases/CartesianR2GyroSonnendruckerShafranov.h deleted file mode 100644 index 05e1771a..00000000 --- a/include/test_cases/CartesianR2GyroSonnendruckerShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroSonnendruckerShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroSonnendruckerTriangular.h b/include/test_cases/CartesianR2GyroSonnendruckerTriangular.h deleted file mode 100644 index cd266e6b..00000000 --- a/include/test_cases/CartesianR2GyroSonnendruckerTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroSonnendruckerTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroZoniCircular.h b/include/test_cases/CartesianR2GyroZoniCircular.h deleted file mode 100644 index 252ac6f1..00000000 --- a/include/test_cases/CartesianR2GyroZoniCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroZoniCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroZoniShafranov.h b/include/test_cases/CartesianR2GyroZoniShafranov.h deleted file mode 100644 index a01d118f..00000000 --- a/include/test_cases/CartesianR2GyroZoniShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroZoniShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroZoniShiftedCircular.h b/include/test_cases/CartesianR2GyroZoniShiftedCircular.h deleted file mode 100644 index 001af54f..00000000 --- a/include/test_cases/CartesianR2GyroZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroZoniShiftedShafranov.h b/include/test_cases/CartesianR2GyroZoniShiftedShafranov.h deleted file mode 100644 index 6c93b95c..00000000 --- a/include/test_cases/CartesianR2GyroZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroZoniShiftedTriangular.h b/include/test_cases/CartesianR2GyroZoniShiftedTriangular.h deleted file mode 100644 index b88c1615..00000000 --- a/include/test_cases/CartesianR2GyroZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2GyroZoniTriangular.h b/include/test_cases/CartesianR2GyroZoniTriangular.h deleted file mode 100644 index 0a415ada..00000000 --- a/include/test_cases/CartesianR2GyroZoniTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2GyroZoniTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2PoissonCircular.h b/include/test_cases/CartesianR2PoissonCircular.h deleted file mode 100644 index 309c09ae..00000000 --- a/include/test_cases/CartesianR2PoissonCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2PoissonCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2PoissonShafranov.h b/include/test_cases/CartesianR2PoissonShafranov.h deleted file mode 100644 index 22755ea1..00000000 --- a/include/test_cases/CartesianR2PoissonShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2PoissonShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2PoissonTriangular.h b/include/test_cases/CartesianR2PoissonTriangular.h deleted file mode 100644 index 2669a926..00000000 --- a/include/test_cases/CartesianR2PoissonTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2PoissonTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2SonnendruckerCircular.h b/include/test_cases/CartesianR2SonnendruckerCircular.h deleted file mode 100644 index a891827c..00000000 --- a/include/test_cases/CartesianR2SonnendruckerCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2SonnendruckerCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2SonnendruckerShafranov.h b/include/test_cases/CartesianR2SonnendruckerShafranov.h deleted file mode 100644 index 4737caf6..00000000 --- a/include/test_cases/CartesianR2SonnendruckerShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2SonnendruckerShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2SonnendruckerTriangular.h b/include/test_cases/CartesianR2SonnendruckerTriangular.h deleted file mode 100644 index 8751c113..00000000 --- a/include/test_cases/CartesianR2SonnendruckerTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2SonnendruckerTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2ZoniCircular.h b/include/test_cases/CartesianR2ZoniCircular.h deleted file mode 100644 index 8fca194b..00000000 --- a/include/test_cases/CartesianR2ZoniCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2ZoniCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2ZoniShafranov.h b/include/test_cases/CartesianR2ZoniShafranov.h deleted file mode 100644 index 04acbd35..00000000 --- a/include/test_cases/CartesianR2ZoniShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2ZoniShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2ZoniShiftedCircular.h b/include/test_cases/CartesianR2ZoniShiftedCircular.h deleted file mode 100644 index ebaa6455..00000000 --- a/include/test_cases/CartesianR2ZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2ZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2ZoniShiftedShafranov.h b/include/test_cases/CartesianR2ZoniShiftedShafranov.h deleted file mode 100644 index eb2787af..00000000 --- a/include/test_cases/CartesianR2ZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2ZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2ZoniShiftedTriangular.h b/include/test_cases/CartesianR2ZoniShiftedTriangular.h deleted file mode 100644 index ba5c628c..00000000 --- a/include/test_cases/CartesianR2ZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2ZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR2ZoniTriangular.h b/include/test_cases/CartesianR2ZoniTriangular.h deleted file mode 100644 index 54cf2073..00000000 --- a/include/test_cases/CartesianR2ZoniTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR2ZoniTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroSonnendruckerCircular.h b/include/test_cases/CartesianR6GyroSonnendruckerCircular.h deleted file mode 100644 index 730fa811..00000000 --- a/include/test_cases/CartesianR6GyroSonnendruckerCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroSonnendruckerCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroSonnendruckerShafranov.h b/include/test_cases/CartesianR6GyroSonnendruckerShafranov.h deleted file mode 100644 index f5433e36..00000000 --- a/include/test_cases/CartesianR6GyroSonnendruckerShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroSonnendruckerShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroSonnendruckerTriangular.h b/include/test_cases/CartesianR6GyroSonnendruckerTriangular.h deleted file mode 100644 index 65e484e7..00000000 --- a/include/test_cases/CartesianR6GyroSonnendruckerTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroSonnendruckerTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroZoniCircular.h b/include/test_cases/CartesianR6GyroZoniCircular.h deleted file mode 100644 index 6dfb4426..00000000 --- a/include/test_cases/CartesianR6GyroZoniCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroZoniCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroZoniShafranov.h b/include/test_cases/CartesianR6GyroZoniShafranov.h deleted file mode 100644 index 9ee83b9c..00000000 --- a/include/test_cases/CartesianR6GyroZoniShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroZoniShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroZoniShiftedCircular.h b/include/test_cases/CartesianR6GyroZoniShiftedCircular.h deleted file mode 100644 index 7f4bcb69..00000000 --- a/include/test_cases/CartesianR6GyroZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroZoniShiftedShafranov.h b/include/test_cases/CartesianR6GyroZoniShiftedShafranov.h deleted file mode 100644 index bdc19f83..00000000 --- a/include/test_cases/CartesianR6GyroZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroZoniShiftedTriangular.h b/include/test_cases/CartesianR6GyroZoniShiftedTriangular.h deleted file mode 100644 index 94976cbc..00000000 --- a/include/test_cases/CartesianR6GyroZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6GyroZoniTriangular.h b/include/test_cases/CartesianR6GyroZoniTriangular.h deleted file mode 100644 index 93611031..00000000 --- a/include/test_cases/CartesianR6GyroZoniTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6GyroZoniTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6PoissonCircular.h b/include/test_cases/CartesianR6PoissonCircular.h deleted file mode 100644 index 621637f6..00000000 --- a/include/test_cases/CartesianR6PoissonCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6PoissonCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6PoissonShafranov.h b/include/test_cases/CartesianR6PoissonShafranov.h deleted file mode 100644 index 6692bd15..00000000 --- a/include/test_cases/CartesianR6PoissonShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6PoissonShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6PoissonTriangular.h b/include/test_cases/CartesianR6PoissonTriangular.h deleted file mode 100644 index 3676de9c..00000000 --- a/include/test_cases/CartesianR6PoissonTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6PoissonTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6SonnendruckerCircular.h b/include/test_cases/CartesianR6SonnendruckerCircular.h deleted file mode 100644 index bcf3776c..00000000 --- a/include/test_cases/CartesianR6SonnendruckerCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6SonnendruckerCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6SonnendruckerShafranov.h b/include/test_cases/CartesianR6SonnendruckerShafranov.h deleted file mode 100644 index 6230f9c2..00000000 --- a/include/test_cases/CartesianR6SonnendruckerShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6SonnendruckerShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6SonnendruckerTriangular.h b/include/test_cases/CartesianR6SonnendruckerTriangular.h deleted file mode 100644 index e66b466c..00000000 --- a/include/test_cases/CartesianR6SonnendruckerTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6SonnendruckerTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6ZoniCircular.h b/include/test_cases/CartesianR6ZoniCircular.h deleted file mode 100644 index 11a028ce..00000000 --- a/include/test_cases/CartesianR6ZoniCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6ZoniCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6ZoniShafranov.h b/include/test_cases/CartesianR6ZoniShafranov.h deleted file mode 100644 index 0dd4f8f9..00000000 --- a/include/test_cases/CartesianR6ZoniShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6ZoniShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6ZoniShiftedCircular.h b/include/test_cases/CartesianR6ZoniShiftedCircular.h deleted file mode 100644 index f8694125..00000000 --- a/include/test_cases/CartesianR6ZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6ZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6ZoniShiftedShafranov.h b/include/test_cases/CartesianR6ZoniShiftedShafranov.h deleted file mode 100644 index 1214790f..00000000 --- a/include/test_cases/CartesianR6ZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6ZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6ZoniShiftedTriangular.h b/include/test_cases/CartesianR6ZoniShiftedTriangular.h deleted file mode 100644 index 3c1e7d9b..00000000 --- a/include/test_cases/CartesianR6ZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6ZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/CartesianR6ZoniTriangular.h b/include/test_cases/CartesianR6ZoniTriangular.h deleted file mode 100644 index 9963b1fa..00000000 --- a/include/test_cases/CartesianR6ZoniTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class CartesianR6ZoniTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroSonnendruckerCircular.h b/include/test_cases/PolarR6GyroSonnendruckerCircular.h deleted file mode 100644 index 6da6cd5a..00000000 --- a/include/test_cases/PolarR6GyroSonnendruckerCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroSonnendruckerCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroSonnendruckerShafranov.h b/include/test_cases/PolarR6GyroSonnendruckerShafranov.h deleted file mode 100644 index 1b034f7e..00000000 --- a/include/test_cases/PolarR6GyroSonnendruckerShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroSonnendruckerShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroSonnendruckerTriangular.h b/include/test_cases/PolarR6GyroSonnendruckerTriangular.h deleted file mode 100644 index 887b81b5..00000000 --- a/include/test_cases/PolarR6GyroSonnendruckerTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroSonnendruckerTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniCircular.h b/include/test_cases/PolarR6GyroZoniCircular.h deleted file mode 100644 index 01dd3f74..00000000 --- a/include/test_cases/PolarR6GyroZoniCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroZoniCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniShafranov.h b/include/test_cases/PolarR6GyroZoniShafranov.h deleted file mode 100644 index c2976c2c..00000000 --- a/include/test_cases/PolarR6GyroZoniShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroZoniShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniShiftedCircular.h b/include/test_cases/PolarR6GyroZoniShiftedCircular.h deleted file mode 100644 index d860fd84..00000000 --- a/include/test_cases/PolarR6GyroZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniShiftedCulham.h b/include/test_cases/PolarR6GyroZoniShiftedCulham.h deleted file mode 100644 index cd3b6fab..00000000 --- a/include/test_cases/PolarR6GyroZoniShiftedCulham.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "exact_funcs.h" - -class PolarR6GyroZoniShiftedCulham: public ExactFuncs -{ -public: - PolarR6GyroZoniShiftedCulham(); - double x(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double rho_glob(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double phi_exact(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double my_sum(std::array& f, int64_t start_idx, int64_t end_idx) const; - double q(double rr) const; - double dq(double rr) const; - double p(double rr) const; - double dp(double rr) const; - double dg(double rr, double g) const; - double double_deriv(double rr, double c, double g, double dg, double val, double d_val) const; - double g(double rr) const; - double Delta(double rr) const; - double Delta_prime(double rr) const; - double E(double rr) const; - double T(double rr) const; - double E_prime(double rr) const; - double T_prime(double rr) const; - double P(double rr) const; - double dP(double rr) const; - double J_xr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_xr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_xr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_xq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_xq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_yr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_yr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_yq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_yq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - std::array g_array; - std::array Delta_array; - std::array Delta_prime_array; - std::array E_array; - std::array T_array; - std::array E_prime_array; - std::array T_prime_array; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniShiftedShafranov.h b/include/test_cases/PolarR6GyroZoniShiftedShafranov.h deleted file mode 100644 index cd28e904..00000000 --- a/include/test_cases/PolarR6GyroZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniShiftedTriangular.h b/include/test_cases/PolarR6GyroZoniShiftedTriangular.h deleted file mode 100644 index f8320225..00000000 --- a/include/test_cases/PolarR6GyroZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6GyroZoniTriangular.h b/include/test_cases/PolarR6GyroZoniTriangular.h deleted file mode 100644 index 6f44fcf2..00000000 --- a/include/test_cases/PolarR6GyroZoniTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6GyroZoniTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6PoissonCircular.h b/include/test_cases/PolarR6PoissonCircular.h deleted file mode 100644 index 84befe50..00000000 --- a/include/test_cases/PolarR6PoissonCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6PoissonCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6PoissonShafranov.h b/include/test_cases/PolarR6PoissonShafranov.h deleted file mode 100644 index e892609e..00000000 --- a/include/test_cases/PolarR6PoissonShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6PoissonShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6PoissonTriangular.h b/include/test_cases/PolarR6PoissonTriangular.h deleted file mode 100644 index 4cd23e0e..00000000 --- a/include/test_cases/PolarR6PoissonTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6PoissonTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6SonnendruckerCircular.h b/include/test_cases/PolarR6SonnendruckerCircular.h deleted file mode 100644 index 888214e2..00000000 --- a/include/test_cases/PolarR6SonnendruckerCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6SonnendruckerCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6SonnendruckerShafranov.h b/include/test_cases/PolarR6SonnendruckerShafranov.h deleted file mode 100644 index 02b36d7e..00000000 --- a/include/test_cases/PolarR6SonnendruckerShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6SonnendruckerShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6SonnendruckerTriangular.h b/include/test_cases/PolarR6SonnendruckerTriangular.h deleted file mode 100644 index aa7e43b3..00000000 --- a/include/test_cases/PolarR6SonnendruckerTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6SonnendruckerTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6ZoniCircular.h b/include/test_cases/PolarR6ZoniCircular.h deleted file mode 100644 index 83942c36..00000000 --- a/include/test_cases/PolarR6ZoniCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6ZoniCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6ZoniShafranov.h b/include/test_cases/PolarR6ZoniShafranov.h deleted file mode 100644 index 179db130..00000000 --- a/include/test_cases/PolarR6ZoniShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6ZoniShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6ZoniShiftedCircular.h b/include/test_cases/PolarR6ZoniShiftedCircular.h deleted file mode 100644 index 312c0156..00000000 --- a/include/test_cases/PolarR6ZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6ZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6ZoniShiftedShafranov.h b/include/test_cases/PolarR6ZoniShiftedShafranov.h deleted file mode 100644 index 15a7fee5..00000000 --- a/include/test_cases/PolarR6ZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6ZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6ZoniShiftedTriangular.h b/include/test_cases/PolarR6ZoniShiftedTriangular.h deleted file mode 100644 index 628971b6..00000000 --- a/include/test_cases/PolarR6ZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6ZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/PolarR6ZoniTriangular.h b/include/test_cases/PolarR6ZoniTriangular.h deleted file mode 100644 index a6f8a693..00000000 --- a/include/test_cases/PolarR6ZoniTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class PolarR6ZoniTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/RefinedGyroZoniShiftedCircular.h b/include/test_cases/RefinedGyroZoniShiftedCircular.h deleted file mode 100644 index 69a7c919..00000000 --- a/include/test_cases/RefinedGyroZoniShiftedCircular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class RefinedGyroZoniShiftedCircular: public ExactFuncs -{ -public: - double x(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const; - void J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/RefinedGyroZoniShiftedCulham.h b/include/test_cases/RefinedGyroZoniShiftedCulham.h deleted file mode 100644 index 2369a64e..00000000 --- a/include/test_cases/RefinedGyroZoniShiftedCulham.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include "exact_funcs.h" - -class RefinedGyroZoniShiftedCulham: public ExactFuncs -{ -public: - RefinedGyroZoniShiftedCulham(); - double x(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void x(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void y(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double rho_glob(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double phi_exact(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double my_sum(std::array& f, int64_t start_idx, int64_t end_idx) const; - double q(double rr) const; - double dq(double rr) const; - double p(double rr) const; - double dp(double rr) const; - double dg(double rr, double g) const; - double double_deriv(double rr, double c, double g, double dg, double val, double d_val) const; - double g(double rr) const; - double Delta(double rr) const; - double Delta_prime(double rr) const; - double E(double rr) const; - double T(double rr) const; - double E_prime(double rr) const; - double T_prime(double rr) const; - double P(double rr) const; - double dP(double rr) const; - double J_xr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_xr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_xr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_xq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_xq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_yr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_yr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const; - void J_yq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const; - void J_yq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - std::array g_array; - std::array Delta_array; - std::array Delta_prime_array; - std::array E_array; - std::array T_array; - std::array E_prime_array; - std::array T_prime_array; -}; - - diff --git a/include/test_cases/RefinedGyroZoniShiftedShafranov.h b/include/test_cases/RefinedGyroZoniShiftedShafranov.h deleted file mode 100644 index 5c0a3166..00000000 --- a/include/test_cases/RefinedGyroZoniShiftedShafranov.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class RefinedGyroZoniShiftedShafranov: public ExactFuncs -{ -public: - double x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/include/test_cases/RefinedGyroZoniShiftedTriangular.h b/include/test_cases/RefinedGyroZoniShiftedTriangular.h deleted file mode 100644 index 7edb7105..00000000 --- a/include/test_cases/RefinedGyroZoniShiftedTriangular.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include -#include -#include "exact_funcs.h" - - -class RefinedGyroZoniShiftedTriangular: public ExactFuncs -{ -public: - double x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; - double coeffs1(double r, double Rmax) const override; - void coeffs1(std::vector const& r, double Rmax, std::vector& sol) const override; - double coeffs2(double r, double Rmax) const override; - void coeffs2(std::vector const& r, double Rmax, std::vector& sol) const override; - double phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const override; - void phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const override; - void phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const override; -private: - double J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; - double J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const; - void J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const; - void J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const; -}; - - diff --git a/make_points_r.py b/make_points_r.py deleted file mode 100644 index 2abbd93a..00000000 --- a/make_points_r.py +++ /dev/null @@ -1,21 +0,0 @@ -from argparse import ArgumentParser -import numpy as np - -parser = ArgumentParser(description='Tool for generating points') -parser.add_argument('Nc', type=int, help='Number of cells (must be a multiple of 2)') -parser.add_argument('outfile', type=str, help='File where points should be printed') -parser.add_argument('--R0', type=float, default=1e-5, help='Minimum radius') -parser.add_argument('--R', type=float, default=1.0, help='Maximum radius') -args = parser.parse_args() - - -R0 = args.R0 -R = args.R -outfile = args.outfile -N = args.Nc - -pts = np.linspace(R0, R, N+1) - -with open(outfile,'w') as f: - for p in pts: - print(p, file=f) diff --git a/scripts/comparison/README.txt b/scripts/comparison/README.txt new file mode 100644 index 00000000..a6f2bbe2 --- /dev/null +++ b/scripts/comparison/README.txt @@ -0,0 +1,3 @@ +Here we compare the results from GMGPolar Version 1.0 to the refactored codebase. +The GMGPolar_1.0 folder and GMGPolar_2.0 folder should be in the same directory. +Pleas adjust the paths in GMGPolar_1.0 and compile the code. diff --git a/scripts/comparison/run_gmgpolar_1.0.sh b/scripts/comparison/run_gmgpolar_1.0.sh new file mode 100755 index 00000000..203ac2f2 --- /dev/null +++ b/scripts/comparison/run_gmgpolar_1.0.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +maxOpenMPThreads=32 + +R0=1e-8 +Rmax=1.3 +nr_exp=4 +ntheta_exp=5 +anisotropic_factor=0 +divideBy2=3 + +DirBC_Interior=0 # Across-origin(0), u_D_Interior(1) + +# Test Cases # +geometry=2 # Circular (0), Shafranov(1), Czarny(2), Culham (3) +kappa_eps=0.3 # Shafranov: 0.3, Czarny = 0.3, else unused +delta_e=1.4 # Shafranov: 0.2, Czarny = 1.4, else unused +problem=6 # CartesianR2(5), CartesianR6(7), PolarR6(6), RefinedRadius(4) +alpha_coeff=0 # Poisson(3), Sonnendrucker(0), Zoni(1), Zoni-Shifted(2) +beta_coeff=1 # Zero(0), Gyro - Alpha Inverse(1) + +extrapolation=1 +maxLevels=3 +preSmoothingSteps=1 +postSmoothingSteps=1 +multigridCycle=0 + +maxIterations=150 +residualNormType=2 # convergence_criterium: scaled L2 (0), scaled inf (1), L2 (2), inf (3) +absoluteTolerance=1e-12 +relativeTolerance=1e-12 + +./../../../GMGPolar_1.0/build/gmgpolar_simulation --verbose 2 --optimized 1 --matrix_free 1 --debug 0 --compute_rho 1 --check_error 1 --write_radii_angles 0 --nr_exp $nr_exp --ntheta_exp $ntheta_exp --fac_ani $anisotropic_factor --level $maxLevels --maxiter $maxIterations --v1 $preSmoothingSteps --v2 $postSmoothingSteps --cycle $multigridCycle --mod_pk $geometry --extrapolation $extrapolation --DirBC_Interior $DirBC_Interior --divideBy2 $divideBy2 --prob $problem --alpha_coeff $alpha_coeff --beta_coeff $beta_coeff --openmp $maxOpenMPThreads --res_norm $residualNormType --R0 $R0 --R $Rmax --kappa_eps $kappa_eps --delta_e $delta_e --tol_bound_check $absoluteTolerance --rel_red_conv $relativeTolerance diff --git a/scripts/comparison/run_gmgpolar_2.0.sh b/scripts/comparison/run_gmgpolar_2.0.sh new file mode 100755 index 00000000..ff816f57 --- /dev/null +++ b/scripts/comparison/run_gmgpolar_2.0.sh @@ -0,0 +1,147 @@ +#!/bin/bash + +# Verbosity level: +# 0 - No output +# 1 - Basic output +verbose=1 +# Set Paraview usage flag: +# 0 - Do not use Paraview +# 1 - Enable Paraview to visualize the grid, solution and error +paraview=0 + +# OpenMP settings: +# Maximum number of threads OpenMP can use for parallel execution +maxOpenMPThreads=32 +# Factor to reduce the number of threads OpenMP uses (e.g., 1.0 means no reduction) +threadReductionFactor=1.0 + +# Stencil distribution method: +# 0 - CPU "Take": Each node independently applies the stencil +# 1 - CPU "Give": The stencil operation is distributed across adjacent neighboring nodes +stencilDistributionMethod=1 +# Caching behavior: +# 0 - Recompute values on each iteration: Uses less memory but results in slower execution. +# 1 - Reuse cached values: Consumes more memory but significantly improves performance. +cacheDensityProfileCoefficients=0 +cacheDomainGeometry=0 +# Note: In the "Take" approach (stencilDistributionMethod=0), +# caching is required for optimal performance, +# so both density profile coefficients and domain geometry need to be cached. +if [[ $stencilDistributionMethod -eq 0 ]]; then + if [[ $cacheDensityProfileCoefficients -ne 1 || $cacheDomainGeometry -ne 1 ]]; then + echo "Error: Caching must be enabled (set to 1) for both density profile coefficients and domain geometry in 'Take' approach (stencilDistributionMethod=0)." + exit 1 + fi +fi + +# Finest grid parameters +R0=1e-8 +Rmax=1.3 +nr_exp=4 +ntheta_exp=5 +anisotropic_factor=0 +divideBy2=3 + +# Finest grid can be loaded from a text file +write_grid_file=0 +load_grid_file=0 +file_grid_radii="_radii.txt" +file_grid_angles="_angles.txt" + +# Interior boundary condition: +# 0: Across-origin +# 1: u_D_Interior +DirBC_Interior=0 + +### Custom Test Cases ### +geometry=2 # Circular (0), Shafranov(1), Czarny(2), Culham (3) +problem=2 # CartesianR2(0), CartesianR6(1), PolarR6(2), RefinedRadius(3) +alpha_coeff=1 # Poisson(0), Sonnendrucker(1), Zoni(2), Zoni-Shifted(3) +beta_coeff=1 # Zero(0), Gyro - Alpha Inverse(1) +# Remark: For RefinedRadius choose alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry choose geometry=3, problem=2,3, alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry the provided exactSolution may be incorrect. + +# Full Multigrid Method: +# 0: Initial approximation is set to zero +# 1: Initial approximation obtained by nested iteration (recommended) +FMG=0 +FMG_iterations=3 +FMG_cycle=2 # V-Cycle(0), W-Cycle(1), F-Cycle(2) + +# Extrapolation Method: +# 0: No extrapolation +# 1: Implicit extrapolation (recommended) +# 2: Implicit extrapolation with full grid smoothing (residuals cannot be used as convergence criteria) +# 3: Combination of both implicit extrapolation methods (May be usefull for FMG=0) +extrapolation=1 +# Maximum number of multigrid levels: +maxLevels=3 +# Number of smoothing steps: +preSmoothingSteps=1 +postSmoothingSteps=1 +# Multigrid Cycle: +# 0: V-Cycle +# 1: W-Cycle +# 2: F-Cycle +multigridCycle=0 + +# Convergence criteria: +maxIterations=150 +residualNormType=0 # L2-Norm(0) = 0, Weighted L2-Norm(1), Infinity-Norm(2) +absoluteTolerance=1e-12 +relativeTolerance=1e-12 + +# Define additional geometry parameters +kappa_eps=0.0 +delta_e=0.0 +if [ "$geometry" -eq 1 ]; then + kappa_eps=0.3 + delta_e=0.2 +elif [ "$geometry" -eq 2 ]; then + kappa_eps=0.3 + delta_e=1.4 +fi + +# Set alpha_jump based on alpha_coeff value +# Used for anisotropic grid refinement -> refinement_radius +if [ "$alpha_coeff" -eq 0 ]; then + alpha_jump=$(python3 -c "print(0.5 * float($Rmax))") +elif [ "$alpha_coeff" -eq 1 ]; then + alpha_jump=$(python3 -c "print(0.66 * float($Rmax))") +elif [ "$alpha_coeff" -eq 2 ]; then + alpha_jump=$(python3 -c "print(0.4837 * float($Rmax))") +elif [ "$alpha_coeff" -eq 3 ]; then + alpha_jump=$(python3 -c "print(0.7081 * float($Rmax))") +else + echo "Invalid value for alpha_coeff: $alpha_coeff" + exit 1 +fi + +# Define additional geometry parameters +kappa_eps=0.0 +delta_e=0.0 +if [ "$geometry" -eq 1 ]; then + kappa_eps=0.3 + delta_e=0.2 +elif [ "$geometry" -eq 2 ]; then + kappa_eps=0.3 + delta_e=1.4 +fi + +# Set alpha_jump based on alpha_coeff value +# Used for anisotropic grid refinement -> refinement_radius +if [ "$alpha_coeff" -eq 0 ]; then + alpha_jump=$(python3 -c "print(0.5 * float($Rmax))") +elif [ "$alpha_coeff" -eq 1 ]; then + alpha_jump=$(python3 -c "print(0.66 * float($Rmax))") +elif [ "$alpha_coeff" -eq 2 ]; then + alpha_jump=$(python3 -c "print(0.4837 * float($Rmax))") +elif [ "$alpha_coeff" -eq 3 ]; then + alpha_jump=$(python3 -c "print(0.7081 * float($Rmax))") +else + echo "Invalid value for alpha_coeff: $alpha_coeff" + exit 1 +fi + +./../../build/gmgpolar --verbose $verbose --paraview $paraview --maxOpenMPThreads $maxOpenMPThreads --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance diff --git a/scripts/compile.sh b/scripts/compile.sh new file mode 100755 index 00000000..0077eb74 --- /dev/null +++ b/scripts/compile.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Function to display usage information +usage() { + echo "Usage: $0 [Debug|Release]" + exit 1 +} + +# Check if build directory exists in the parent directory +if [ -d "../build" ]; then + build_exists=true +else + build_exists=false +fi + +# Check if build directory exists and delete if it does (only if an argument is provided) +if [ -n "$1" ] && [ -d "../build" ]; then + echo "Removing existing build directory..." + rm -rf ../build || { echo "Failed to remove build directory"; exit 1; } + build_exists=false +fi + +# Create build directory in the parent directory if it doesn't exist and if a build folder didn't exist before +if ! $build_exists; then + echo "Creating build directory..." + mkdir -p ../build || { echo "Failed to create build directory"; exit 1; } + build_exists=true +fi + +# Determine build type +if [ -n "$1" ]; then + case "$1" in + Debug) + build_type="Debug" + ;; + Release) + build_type="Release" + ;; + *) + echo "Invalid build type. Please specify Debug or Release." + usage + ;; + esac +else + if [ "$build_exists" != true ]; then + echo "No build type specified. Please provide either Debug or Release." + usage + fi +fi + +if [ -n "$build_type" ]; then + echo "Configuring with $build_type build type..." + cmake -S ${PWD}/.. -B ${PWD}/../build -DCMAKE_BUILD_TYPE="$build_type" -DCMAKE_PREFIX_PATH="/scratch/spack-23.2/opt/spack/linux-ubuntu20.04-x86_64_v3/gcc-12.3.0/mumps-5.5.1-afnceqpp75o4zmfmqpbvr4whi2li2r4i" .. || { echo "CMake configuration failed"; exit 1; } +fi + +cmake --build ${PWD}/../build -j 16 diff --git a/scripts/ctest.sh b/scripts/ctest.sh new file mode 100755 index 00000000..4abffad7 --- /dev/null +++ b/scripts/ctest.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Navigate to the build directory +cd ../build || { echo "Build folder not found!"; exit 1; } + +# Run ctest in verbose mode +ctest --verbose \ No newline at end of file diff --git a/scripts/memory_usage/memory_usage.py b/scripts/memory_usage/memory_usage.py new file mode 100644 index 00000000..a01526c8 --- /dev/null +++ b/scripts/memory_usage/memory_usage.py @@ -0,0 +1,39 @@ +import re + +### Evaluates the maximum memory usage from a given Valgrind output file. ### +### Warning: Valgrind does not support mumps! ### + +# Define the filename +filename = 'massif.out.328959' + +# Initialize variables to store maximum memory usage +max_memory_usage_MB = 0 + +# Use regular expressions to find all occurrences of memory usage +heap_pattern = re.compile(r'mem_heap_B=(\d+)') +extra_pattern = re.compile(r'mem_heap_extra_B=(\d+)') + +try: + with open(filename, 'r') as file: + data = file.read() + + # Find all matches in the data + heap_matches = heap_pattern.findall(data) + extra_matches = extra_pattern.findall(data) + + # Calculate the maximum memory usage in megabytes + for heap, extra in zip(heap_matches, extra_matches): + heap_B = int(heap) + extra_B = int(extra) + total_memory_B = heap_B + extra_B + total_memory_MB = total_memory_B / (1024 * 1024) # Convert bytes to megabytes + if total_memory_MB > max_memory_usage_MB: + max_memory_usage_MB = total_memory_MB + + # Print the maximum memory usage + print(f"Maximum memory usage: {max_memory_usage_MB:.2f} MB") + +except FileNotFoundError: + print(f"Error: The file '{filename}' does not exist.") +except Exception as e: + print(f"An error occurred: {e}") diff --git a/scripts/old_scripts/README.txt b/scripts/old_scripts/README.txt new file mode 100644 index 00000000..22916650 --- /dev/null +++ b/scripts/old_scripts/README.txt @@ -0,0 +1,2 @@ +This folder contains scripts from GMGPolar Version 1.0 development. +These scripts are no longer supported. \ No newline at end of file diff --git a/batch.sh_paper b/scripts/old_scripts/batch/batch.sh_paper similarity index 100% rename from batch.sh_paper rename to scripts/old_scripts/batch/batch.sh_paper diff --git a/batch.sh b/scripts/old_scripts/batch_deprecated/batch.sh similarity index 100% rename from batch.sh rename to scripts/old_scripts/batch_deprecated/batch.sh diff --git a/batch_omp.sh b/scripts/old_scripts/batch_deprecated/batch_omp.sh similarity index 100% rename from batch_omp.sh rename to scripts/old_scripts/batch_deprecated/batch_omp.sh diff --git a/batch_write_radii_angles.sh b/scripts/old_scripts/batch_deprecated/batch_write_radii_angles.sh similarity index 100% rename from batch_write_radii_angles.sh rename to scripts/old_scripts/batch_deprecated/batch_write_radii_angles.sh diff --git a/scripts/old_scripts/batch_deprecated/test_culham.sh b/scripts/old_scripts/batch_deprecated/test_culham.sh new file mode 100755 index 00000000..3a19e5d2 --- /dev/null +++ b/scripts/old_scripts/batch_deprecated/test_culham.sh @@ -0,0 +1,37 @@ +# Deprecated script. + +# Original Output: +# terminate called after throwing an instance of 'std::runtime_error' +# what(): Wrong choice for the geometry + +if [ -z $1 ] || [ -z $2 ] +then + echo "Please provide cell sizes for test" +else + if [ $(($1 % 2)) -eq 1 ] + then + echo "There must be an even number of cells (r direction)" + else + if [ $(($2 % 2)) -eq 1 ] + then + echo "There must be an even number of cells (theta direction)" + else + + mkdir -p culham + + cd culham + + python3 ../../python/make_points_r.py $1 r.txt --R0 1e-3 --R 1.0 + python3 ../../python/make_points_theta.py $2 theta.txt + + build_dir=build_gnu + + # Refactoring changes: + # ../${build_dir}/main -n 4 -a 0 --mod_pk 3 --DirBC_Interior 1 --divideBy2 0 -r 1e-5 --smoother 3 --verbose 2 --debug 0 --extrapolation 0 --optimized 1 --openmp 4 --v1 1 --v2 1 -R 1 --prob 7 --maxiter 300 --alpha_coeff 2 --beta_coeff 1 --res_norm 3 --f_grid_r "r.txt" --f_grid_theta "theta.txt" --rel_red_conv 1e-9 --f_sol_out out.txt + ../${build_dir}/gmgpolar --nr_exp 4 --anisotropic_factor 0 --geometry 3 --DirBC_Interior 1 --divideBy2 0 --R0 1e-5 --verbose 2 --extrapolation 0 --openmp 4 --preSmoothingSteps 1 --postSmoothingSteps 1 --Rmax 1.0 --problem 1 --maxIterations 300 --alpha_coeff 3 --alpha_jump 0.7081 --beta_coeff 1 --residualNormType 2 --write_grid_file $write_grid_file --load_grid_file 1 --file_grid_radii "r.txt" --file_grid_angles "theta.txt" + + python3 ../../python/plot_culham.py + + fi + fi +fi diff --git a/performance/run_gmgpolar.sh b/scripts/old_scripts/performance/run_gmgpolar.sh similarity index 100% rename from performance/run_gmgpolar.sh rename to scripts/old_scripts/performance/run_gmgpolar.sh diff --git a/plot_tools/lskkr23_plot_benchmarks_strong_scaling.py b/scripts/old_scripts/plot_tools/lskkr23_plot_benchmarks_strong_scaling.py similarity index 100% rename from plot_tools/lskkr23_plot_benchmarks_strong_scaling.py rename to scripts/old_scripts/plot_tools/lskkr23_plot_benchmarks_strong_scaling.py diff --git a/plot_tools/lskkr23_plot_sol_coeff_compute_flops.ipynb b/scripts/old_scripts/plot_tools/lskkr23_plot_sol_coeff_compute_flops.ipynb similarity index 100% rename from plot_tools/lskkr23_plot_sol_coeff_compute_flops.ipynb rename to scripts/old_scripts/plot_tools/lskkr23_plot_sol_coeff_compute_flops.ipynb diff --git a/plot_tools/lskkr23_plot_weak_scaling.py b/scripts/old_scripts/plot_tools/lskkr23_plot_weak_scaling.py similarity index 100% rename from plot_tools/lskkr23_plot_weak_scaling.py rename to scripts/old_scripts/plot_tools/lskkr23_plot_weak_scaling.py diff --git a/plot_tools/lskkr23_read_output_strong_scaling.py b/scripts/old_scripts/plot_tools/lskkr23_read_output_strong_scaling.py similarity index 100% rename from plot_tools/lskkr23_read_output_strong_scaling.py rename to scripts/old_scripts/plot_tools/lskkr23_read_output_strong_scaling.py diff --git a/TEST_CART/make_points_r.py b/scripts/old_scripts/python/make_points_r.py similarity index 100% rename from TEST_CART/make_points_r.py rename to scripts/old_scripts/python/make_points_r.py diff --git a/make_points_theta.py b/scripts/old_scripts/python/make_points_theta.py similarity index 100% rename from make_points_theta.py rename to scripts/old_scripts/python/make_points_theta.py diff --git a/parse_rhs.py b/scripts/old_scripts/python/parse_rhs.py similarity index 100% rename from parse_rhs.py rename to scripts/old_scripts/python/parse_rhs.py diff --git a/plot_culham.py b/scripts/old_scripts/python/plot_culham.py similarity index 100% rename from plot_culham.py rename to scripts/old_scripts/python/plot_culham.py diff --git a/print_tables.py b/scripts/old_scripts/python/print_tables.py similarity index 100% rename from print_tables.py rename to scripts/old_scripts/python/print_tables.py diff --git a/treat_output.py b/scripts/old_scripts/python/treat_output.py similarity index 99% rename from treat_output.py rename to scripts/old_scripts/python/treat_output.py index a2f9e1a3..6681bb76 100644 --- a/treat_output.py +++ b/scripts/old_scripts/python/treat_output.py @@ -13,9 +13,6 @@ #create new file for latex code latex = open('latex.txt', 'w') - - - count = 0 number = 0 @@ -113,13 +110,3 @@ print("done!") - - - - - - - - - - diff --git a/scripts/performance_likwid/plots/plot_data.py b/scripts/performance_likwid/plots/plot_data.py new file mode 100644 index 00000000..a9390c42 --- /dev/null +++ b/scripts/performance_likwid/plots/plot_data.py @@ -0,0 +1,369 @@ +import re +import matplotlib.pyplot as plt + +### ------------------------ ### +### Input test configuration ### +### ------------------------ ### + +folder = "../example_data/data_give_1537x2048" +nr = 1537 +ntheta = 2048 + +### Define the number of sockets and socket size ### +sockets = 4 +socket_size = 14 +cores = 56 + +### Version 1: Custom core list ### +# core_list=[1, 2, 4, 8, 16, 32, 56] + +### Version 2: Test all core configurations ### +core_list = [i for i in range(1, cores + 1)] + +### ---------------- ### +### Used for x-ticks ### +### ---------------- ### + +total_threads = sockets * socket_size + +def get_divisors(n): + """Return the list of divisors of n.""" + divisors = [] + for i in range(1, n + 1): + if n % i == 0: + divisors.append(i) + return divisors + +divisors = get_divisors(total_threads) + +### ----------------------- ### +### Extract data from table ### +### ----------------------- ### + +def parse_data_from_file(filename, num_cores): + + with open(filename, 'r') as file: + lines = file.readlines() + + headers = [] + current_line = 0 + if num_cores == 1: + for line in lines: + if ('Metric' in line and 'Core' in line) or ('Metric' in line and 'HWThread' in line): + headers.append(current_line) + current_line += 1 + else: + for line in lines: + if 'Metric' in line and 'Sum' in line: + headers.append(current_line) + current_line += 1 + + matrix = [[''] * 3 for _ in range(10)] + matrix[0][0] = 'Metric' + matrix[1][0] = 'Runtime (RDTSC) [s]' + matrix[2][0] = 'Runtime unhalted [s]' + matrix[3][0] = 'CPI' + matrix[4][0] = 'Energy [J]' + matrix[5][0] = 'Power [W]' + matrix[6][0] = 'DP [MFLOP/s]' + matrix[7][0] = 'Memory bandwidth [MBytes/s]' + matrix[8][0] = 'Memory data volume [GBytes]' + matrix[9][0] = 'Operational intensity' + offset = [0, 2, 3, 5, 6, 7, 10, 18, 19, 20] # Identifies the row in the table + + + matrix[0][1] = 'Setup' + if num_cores==1: + matrix[1][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[1]]).group(0)) + matrix[2][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[2]]).group(0)) + else: + matrix[1][1] = float(re.findall(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[1]])[2]) + matrix[2][1] = float(re.findall(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[2]])[2]) + + matrix[3][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[3]]).group(0)) + matrix[4][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[4]]).group(0)) + matrix[5][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[5]]).group(0)) + matrix[6][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[6]]).group(0)) + matrix[7][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[7]]).group(0)) + matrix[8][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[8]]).group(0)) + matrix[9][1] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[0] + offset[9]]).group(0)) + + + matrix[0][2] = 'Solve' + if num_cores==1: + matrix[1][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[1]]).group(0)) + matrix[2][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[2]]).group(0)) + else: + matrix[1][2] = float(re.findall(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[1]])[2]) + matrix[2][2] = float(re.findall(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[2]])[2]) + + matrix[3][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[3]]).group(0)) + matrix[4][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[4]]).group(0)) + matrix[5][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[5]]).group(0)) + matrix[6][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[6]]).group(0)) + matrix[7][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[7]]).group(0)) + matrix[8][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[8]]).group(0)) + matrix[9][2] = float(re.search(r"[-+]?\d*\.\d+|\d+", lines[headers[1] + offset[9]]).group(0)) + + return matrix + +### --------- ### +### Plot data ### +### --------- ### + +def main(): + ## --------- ## + ## Load Data ## + ## --------- ## + + compact_data = [] + for num_cores in core_list: + filename_compact_mem = folder + '/COMPACT_MEM_DP_%d.txt' % num_cores + matrix_compact_mem = parse_data_from_file(filename_compact_mem, num_cores) + compact_data.append(matrix_compact_mem) + + # print(f"Results for {filename_compact_mem}:") + # for row in matrix_compact_mem: + # print(row) + # print("\n" + "="*50 + "\n") + + spread_data = [] + for num_cores in core_list: + filename_spread_mem = folder + '/SPREAD_MEM_DP_%d.txt' % num_cores + matrix_spread_mem = parse_data_from_file(filename_spread_mem, num_cores) + spread_data.append(matrix_spread_mem) + + # print(f"Results for {filename_spread_mem}:") + # for row in matrix_spread_mem: + # print(row) + # print("\n" + "="*50 + "\n") + + ## ------------- ## + ## Plot: Runtime ## + ## ------------- ## + + setup_compact = [sublist[1][1] for sublist in compact_data] + setup_spread = [sublist[1][1] for sublist in spread_data] + solve_compact = [sublist[1][2] for sublist in compact_data] + solve_spread = [sublist[1][2] for sublist in spread_data] + + plt.figure(figsize=(10, 6)) + + plt.plot(core_list, solve_compact, marker='o', markersize = 5, label='Solve [s] - compact pinning', color='red', linewidth=2) + plt.plot(core_list, solve_spread, marker='o', markersize = 5, label='Solve [s] - spread pinning', color='blue', linewidth=2) + plt.plot(core_list, setup_compact, marker='o', markersize = 5, label='Setup [s] - compact pinning', color='orangered', linestyle='--', linewidth=2) + plt.plot(core_list, setup_spread, marker='o', markersize = 5, label='Setup [s] - spread pinning', color='dodgerblue', linestyle='--', linewidth=2) + + initial_time = solve_compact[0] # First value in TotalTime (with the fewest threads) + optimal_times = [initial_time / t for t in core_list] # Ideal scaling times + # Plot the optimal line + plt.plot(core_list, optimal_times, 'k--', label='_nolegend_') + + plt.xscale('log') + plt.xticks(divisors, labels=[str(d) for d in divisors]) + # Add vertical lines at multiples of socket_size + plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) + for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + + plt.yscale('log') + plt.xlabel('Number of threads') + plt.ylabel('Execution time [s]') + plt.title(f'Parallel Performance - Czarny Geometry ({nr} x {ntheta})') + plt.legend() + plt.grid(True, which="both", ls="--") + + plt.savefig('1_Runtime.png') + + ## ---------------------------- ## + ## Plot: Cycles per instruction ## + ## ---------------------------- ## + + setup_compact = [sublist[3][1] for sublist in compact_data] + setup_spread = [sublist[3][1] for sublist in spread_data] + solve_compact = [sublist[3][2] for sublist in compact_data] + solve_spread = [sublist[3][2] for sublist in spread_data] + + plt.figure(figsize=(10, 6)) + + plt.plot(core_list, solve_compact, marker='o', markersize = 5, label='Solve: CPI - compact pinning', color='red', linewidth=2) + plt.plot(core_list, solve_spread, marker='o', markersize = 5, label='Solve: CPI - spread pinning', color='blue', linewidth=2) + plt.plot(core_list, setup_compact, marker='o', markersize = 5, label='Setup: CPI - compact pinning', color='orangered', linestyle='--', linewidth=2) + plt.plot(core_list, setup_spread, marker='o', markersize = 5, label='Setup: CPI - spread pinning', color='dodgerblue', linestyle='--', linewidth=2) + + initial_time = solve_compact[0] # First value in TotalTime (with the fewest threads) + optimal_times = [initial_time * t for t in core_list] # Ideal scaling times + # Plot the optimal line + plt.plot(core_list, optimal_times, 'k--', label='_nolegend_') + + plt.xscale('log') + plt.xticks(divisors, labels=[str(d) for d in divisors]) + # Add vertical lines at multiples of socket_size + plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) + for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + + # Labels and title + plt.yscale('log') + plt.xlabel('Number of threads') + plt.ylabel('Cycles per Instruction') + plt.title(f'Cycles per Instruction - Czarny Geometry ({nr} x {ntheta})') + plt.legend() + plt.grid(True, which="both", ls="--") + + plt.savefig('2_CyclesPerInstruction.png') + + ## ------------------------------------------------- ## + ## Plot: Double Floating Point Operations Per Second ## + ## ------------------------------------------------- ## + + setup_compact = [sublist[6][1] for sublist in compact_data] + setup_spread = [sublist[6][1] for sublist in spread_data] + solve_compact = [sublist[6][2] for sublist in compact_data] + solve_spread = [sublist[6][2] for sublist in spread_data] + + plt.figure(figsize=(10, 6)) + + plt.plot(core_list, solve_compact, marker='o', markersize = 5, label='Solve: DP [MFLOP/s] - compact pinning', color='red', linewidth=2) + plt.plot(core_list, solve_spread, marker='o', markersize = 5, label='Solve: DP [MFLOP/s] - spread pinning', color='blue', linewidth=2) + plt.plot(core_list, setup_compact, marker='o', markersize = 5, label='Setup: DP [MFLOP/s] - compact pinning', color='orangered', linestyle='--', linewidth=2) + plt.plot(core_list, setup_spread, marker='o', markersize = 5, label='Setup: DP [MFLOP/s] - spread pinning', color='dodgerblue', linestyle='--', linewidth=2) + + initial_time = solve_compact[0] # First value in TotalTime (with the fewest threads) + optimal_times = [initial_time * t for t in core_list] # Ideal scaling times + # Plot the optimal line + plt.plot(core_list, optimal_times, 'k--', label='_nolegend_') + + plt.xscale('log') + plt.xticks(divisors, labels=[str(d) for d in divisors]) + # Add vertical lines at multiples of socket_size + plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) + for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + + # Labels and title + plt.yscale('log') + plt.xlabel('Number of threads') + plt.ylabel('DP [MFLOP/s]') + plt.title(f'DP [MFLOP/s] - Czarny Geometry ({nr} x {ntheta})') + plt.legend() + plt.grid(True, which="both", ls="--") + + plt.savefig('3_FLOPS_DP.png') + + ## ---------------------- ## + ## Plot: Memory Bandwidth ## + ## ---------------------- ## + + setup_compact = [sublist[7][1] for sublist in compact_data] + setup_spread = [sublist[7][1] for sublist in spread_data] + solve_compact = [sublist[7][2] for sublist in compact_data] + solve_spread = [sublist[7][2] for sublist in spread_data] + + plt.figure(figsize=(10, 6)) + + plt.plot(core_list, solve_compact, marker='o', markersize = 5, label='Solve: Memory bandwidth [MBytes/s] - compact pinning', color='red', linewidth=2) + plt.plot(core_list, solve_spread, marker='o', markersize = 5, label='Solve: Memory bandwidth [MBytes/s] - spread pinning', color='blue', linewidth=2) + plt.plot(core_list, setup_compact, marker='o', markersize = 5, label='Setup: Memory bandwidth [MBytes/s] - compact pinning', color='orangered', linestyle='--', linewidth=2) + plt.plot(core_list, setup_spread, marker='o', markersize = 5, label='Setup: Memory bandwidth [MBytes/s] - spread pinning', color='dodgerblue', linestyle='--', linewidth=2) + + initial_time = solve_compact[0] # First value in TotalTime (with the fewest threads) + optimal_times = [initial_time * t for t in core_list] # Ideal scaling times + # Plot the optimal line + plt.plot(core_list, optimal_times, 'k--', label='_nolegend_') + + plt.xscale('log') + plt.xticks(divisors, labels=[str(d) for d in divisors]) + # Add vertical lines at multiples of socket_size + plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) + for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + + # Labels and title + plt.yscale('log') + plt.xlabel('Number of threads') + plt.ylabel('Memory bandwidth [MBytes/s]') + plt.title(f'Memory bandwidth [MBytes/s] - Czarny Geometry ({nr} x {ntheta})') + plt.legend() + plt.grid(True, which="both", ls="--") + + plt.savefig('4_Memory_Bandwidth.png') + + ## ------------------------ ## + ## Plot: Memory Data Volume ## + ## ------------------------ ## + + setup_compact = [sublist[8][1] for sublist in compact_data] + setup_spread = [sublist[8][1] for sublist in spread_data] + solve_compact = [sublist[8][2] for sublist in compact_data] + solve_spread = [sublist[8][2] for sublist in spread_data] + + plt.figure(figsize=(10, 6)) + + plt.plot(core_list, solve_compact, marker='o', markersize = 5, label='Solve: Memory bandwidth [MBytes/s] - compact pinning', color='red', linewidth=2) + plt.plot(core_list, solve_spread, marker='o', markersize = 5, label='Solve: Memory bandwidth [MBytes/s] - spread pinning', color='blue', linewidth=2) + plt.plot(core_list, setup_compact, marker='o', markersize = 5, label='Setup: Memory bandwidth [MBytes/s] - compact pinning', color='orangered', linestyle='--', linewidth=2) + plt.plot(core_list, setup_spread, marker='o', markersize = 5, label='Setup: Memory bandwidth [MBytes/s] - spread pinning', color='dodgerblue', linestyle='--', linewidth=2) + + plt.xscale('log') + plt.xticks(divisors, labels=[str(d) for d in divisors]) + # Add vertical lines at multiples of socket_size + plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) + for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + + # Labels and title + plt.yscale('log') + plt.xlabel('Number of threads') + plt.ylabel('Memory data volume [GBytes]') + plt.title(f'Memory data volume [GBytes] - Czarny Geometry ({nr} x {ntheta})') + plt.legend() + plt.grid(True, which="both", ls="--") + + plt.savefig('5_Memory_DataVolume.png') + + ## --------------------------- ## + ## Plot: Operational Intensity ## + ## --------------------------- ## + + setup_compact = [sublist[9][1] for sublist in compact_data] + setup_spread = [sublist[9][1] for sublist in spread_data] + solve_compact = [sublist[9][2] for sublist in compact_data] + solve_spread = [sublist[9][2] for sublist in spread_data] + + plt.figure(figsize=(10, 6)) + + plt.plot(core_list, solve_compact, marker='o', markersize = 5, label='Solve: Operational intensity - compact pinning', color='red', linewidth=2) + plt.plot(core_list, solve_spread, marker='o', markersize = 5, label='Solve: Operational intensity - spread pinning', color='blue', linewidth=2) + plt.plot(core_list, setup_compact, marker='o', markersize = 5, label='Setup: Operational intensity - compact pinning', color='orangered', linestyle='--', linewidth=2) + plt.plot(core_list, setup_spread, marker='o', markersize = 5, label='Setup: Operational intensity - spread pinning', color='dodgerblue', linestyle='--', linewidth=2) + + plt.xscale('log') + plt.xticks(divisors, labels=[str(d) for d in divisors]) + # Add vertical lines at multiples of socket_size + plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) + for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + + plt.ylim(bottom= 0.7 * min(solve_compact + setup_compact), top= 1.3 * max(solve_compact + setup_compact)) + + # Labels and title + plt.yscale('log') + plt.xlabel('Number of threads') + plt.ylabel('Operational intensity') + plt.title(f'Operational intensity - Czarny Geometry ({nr} x {ntheta})') + + plt.legend() + plt.grid(True, which="both", ls="--") + + plt.savefig('6_Operational_Intensity.png') + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/scripts/performance_likwid/start_likwid_benchmark.sh b/scripts/performance_likwid/start_likwid_benchmark.sh new file mode 100644 index 00000000..aebaaa93 --- /dev/null +++ b/scripts/performance_likwid/start_likwid_benchmark.sh @@ -0,0 +1,313 @@ +#!/bin/bash +#SBATCH --job-name=gmgpolar-setup +#SBATCH --output=/dev/null +#SBATCH --error=/dev/null +#SBATCH -N 1 +#SBATCH -n 1 +#SBATCH -c 1 +#SBATCH -t 5 + +### Original file: old_scripts/performance/run_gmgpolar.sh ### + +nodes=1 +ranks=1 +sockets=4 +socket_size=14 +cores=($(($sockets * $socket_size))) + +### Version 1: Custom core list ### +# core_list=(1 2 4 8 16 32 56) + +### Version 2: Test all configurations ### +core_list=() +for ((i=1; i<=$cores; i+=1)); do + core_list+=($i) +done + +# Verbosity level: +# 0 - No output +# 1 - Basic output +verbose=1 +# Set Paraview usage flag: +# 0 - Do not use Paraview +# 1 - Enable Paraview to visualize the grid, solution and error +paraview=0 + +# OpenMP settings: +# Maximum number of threads OpenMP can use for parallel execution +maxOpenMPThreads=$cores # Iterate over 1:2:maxOpenMPThreads +# Factor to reduce the number of threads OpenMP uses (e.g., 1.0 means no reduction) +threadReductionFactor=1.0 + +# Stencil distribution method: +# 0 - CPU "Take": Each node independently applies the stencil +# 1 - CPU "Give": The stencil operation is distributed across adjacent neighboring nodes +stencilDistributionMethod=1 +# Caching behavior: +# 0 - Recompute values on each iteration: Uses less memory but results in slower execution. +# 1 - Reuse cached values: Consumes more memory but significantly improves performance. +cacheDensityProfileCoefficients=1 +cacheDomainGeometry=0 +# Note: In the "Take" approach (stencilDistributionMethod=0), +# caching is required for optimal performance, +# so both density profile coefficients and domain geometry need to be cached. +if [[ $stencilDistributionMethod -eq 0 ]]; then + if [[ $cacheDensityProfileCoefficients -ne 1 || $cacheDomainGeometry -ne 1 ]]; then + echo "Error: Caching must be enabled (set to 1) for both density profile coefficients and domain geometry in 'Take' approach (stencilDistributionMethod=0)." + exit 1 + fi +fi + +# Finest grid parameters +R0=1e-8 +Rmax=1.3 +nr_exp=4 +ntheta_exp=-1 +anisotropic_factor=3 +divideBy2=5 + +# Finest grid can be loaded from a text file +write_grid_file=0 +load_grid_file=0 +file_grid_radii="_radii.txt" +file_grid_angles="_angles.txt" + +# Interior boundary condition: +# 0: Across-origin +# 1: u_D_Interior +DirBC_Interior=1 + +### Custom Test Cases ### +geometry=2 # Circular (0), Shafranov(1), Czarny(2), Culham (3) +problem=1 # CartesianR2(0), CartesianR6(1), PolarR6(2), RefinedRadius(3) +alpha_coeff=2 # Poisson(0), Sonnendrucker(1), Zoni(2), Zoni-Shifted(3) +beta_coeff=1 # Zero(0), Gyro - Alpha Inverse(1) +# Remark: For RefinedRadius choose alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry choose geometry=3, problem=2,3, alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry the provided exactSolution may be incorrect. + +# Full Multigrid Method: +# 0: Initial approximation is set to zero +# 1: Initial approximation obtained by nested iteration (recommended) +FMG=0 +FMG_iterations=3 +FMG_cycle=2 # V-Cycle(0), W-Cycle(1), F-Cycle(2) + +# Extrapolation Method: +# 0: No extrapolation +# 1: Implicit extrapolation (recommended) +# 2: Implicit extrapolation with full grid smoothing (residuals cannot be used as convergence criteria) +# 3: Combination of both implicit extrapolation methods (May be usefull for FMG=0) +extrapolation=1 +# Maximum number of multigrid levels: +maxLevels=7 +# Number of smoothing steps: +preSmoothingSteps=1 +postSmoothingSteps=1 +# Multigrid Cycle: +# 0: V-Cycle +# 1: W-Cycle +# 2: F-Cycle +multigridCycle=0 + +# Convergence criteria: +maxIterations=150 +residualNormType=0 # L2-Norm(0) = 0, Weighted L2-Norm(1), Infinity-Norm(2) +absoluteTolerance=1e-10 +relativeTolerance=1e-10 + +# Define additional geometry parameters +kappa_eps=0.0 +delta_e=0.0 +if [ "$geometry" -eq 1 ]; then + kappa_eps=0.3 + delta_e=0.2 +elif [ "$geometry" -eq 2 ]; then + kappa_eps=0.3 + delta_e=1.4 +fi + +# Set alpha_jump based on alpha_coeff value +# Used for anisotropic grid refinement -> refinement_radius +if [ "$alpha_coeff" -eq 0 ]; then + alpha_jump=$(python3 -c "print(0.5 * float($Rmax))") +elif [ "$alpha_coeff" -eq 1 ]; then + alpha_jump=$(python3 -c "print(0.66 * float($Rmax))") +elif [ "$alpha_coeff" -eq 2 ]; then + alpha_jump=$(python3 -c "print(0.4837 * float($Rmax))") +elif [ "$alpha_coeff" -eq 3 ]; then + alpha_jump=$(python3 -c "print(0.7081 * float($Rmax))") +else + echo "Invalid value for alpha_coeff: $alpha_coeff" + exit 1 +fi + +### -------------- ### +### Create Storage ### +folder="data" +if [ -d "$folder" ]; then + rm -rf "$folder" +fi +mkdir "$folder" + + +### ----------------------------------------- ### +### Build run_COMPACT_FLOPS_DP_likwid.sh file ### +echo "#!/bin/bash" > run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH --job-name=FLOPS_DP" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH --output=../slurm_output/slurm-%A-COMPACT-FLOPS_DP-geom$geometry-prob$problem.out" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH --error=../slurm_output/slurm-%A-COMPACT-FLOPS_DP-geom$geometry-prob$problem.err" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH -N $nodes" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH -n $ranks" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH -c $cores" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH --threads-per-core=1" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH --cpu-freq=1800000" >> run_COMPACT_FLOPS_DP_likwid.sh +echo '#SBATCH --nodelist="be-cpu02"' >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH -t 1440" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "#SBATCH --exclusive" >> run_COMPACT_FLOPS_DP_likwid.sh + +echo "" >> run_COMPACT_FLOPS_DP_likwid.sh + +echo "# potentially run benchmark on machine" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "# srun --cpus-per-task=$((cores)) likwid-bench -i 1000 -t stream_avx_fma -w S0:500MB:64" >> run_COMPACT_FLOPS_DP_likwid.sh + +echo "" >> run_COMPACT_FLOPS_DP_likwid.sh + +echo "core_list=( ${core_list[@]} )" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "for m in \${core_list[@]}; do" >> run_COMPACT_FLOPS_DP_likwid.sh +echo " let mminus1=m-1" >> run_COMPACT_FLOPS_DP_likwid.sh +echo ' output_file="data/COMPACT_FLOPS_DP_${m}.txt"' >> run_COMPACT_FLOPS_DP_likwid.sh +echo " # for testing that pin works correctly, potentially use likwid-pin beforehand" >> run_COMPACT_FLOPS_DP_likwid.sh +echo " # srun --cpus-per-task=$((cores)) likwid-pin -C E:N:\$m ./../../build/gmgpolar --verbose $verbose --paraview $paraview --maxOpenMPThreads \$m --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance" >> run_COMPACT_FLOPS_DP_likwid.sh +echo " srun --cpus-per-task=$((cores)) likwid-perfctr -f -m -C E:N:\$m -g FLOPS_DP -o \$output_file ./../../build/gmgpolar --verbose $verbose --paraview $paraview --maxOpenMPThreads \$m --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance" >> run_COMPACT_FLOPS_DP_likwid.sh +echo "done;" >> run_COMPACT_FLOPS_DP_likwid.sh +### ----------------------------------------- ### + + +### --------------------------------------- ### +### Build run_COMPACT_MEM_DP_likwid.sh file ### +echo "#!/bin/bash" > run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH --job-name=MEM_DP" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH --output=../slurm_output/slurm-%A-COMPACT-MEM_DP-geom$geometry-prob$problem.out" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH --error=../slurm_output/slurm-%A-COMPACT-MEM_DP-geom$geometry-prob$problem.err" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH -N $nodes" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH -n $ranks" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH -c $cores" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH --threads-per-core=1" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH --cpu-freq=1800000" >> run_COMPACT_MEM_DP_likwid.sh +echo '#SBATCH --nodelist="be-cpu02"' >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH -t 1440" >> run_COMPACT_MEM_DP_likwid.sh +echo "#SBATCH --exclusive" >> run_COMPACT_MEM_DP_likwid.sh + +echo "" >> run_COMPACT_MEM_DP_likwid.sh + +echo "# potentially run benchmark on machine" >> run_COMPACT_MEM_DP_likwid.sh +echo "# srun --cpus-per-task=$((cores)) likwid-bench -i 1000 -t stream_avx_fma -w S0:500MB:64" >> run_COMPACT_MEM_DP_likwid.sh + +echo "" >> run_COMPACT_MEM_DP_likwid.sh + +echo "core_list=( ${core_list[@]} )" >> run_COMPACT_MEM_DP_likwid.sh +echo "for m in \${core_list[@]}; do" >> run_COMPACT_MEM_DP_likwid.sh +echo " let mminus1=m-1" >> run_COMPACT_MEM_DP_likwid.sh +echo ' output_file="data/COMPACT_MEM_DP_${m}.txt"' >> run_COMPACT_MEM_DP_likwid.sh +echo " # for testing that pin works correctly, potentially use likwid-pin beforehand" >> run_COMPACT_MEM_DP_likwid.sh +echo " # srun --cpus-per-task=$((cores)) likwid-pin -C E:N:\$m ./../../build/gmgpolar --verbose $verbose --paraview $paraview --maxOpenMPThreads \$m --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance" >> run_COMPACT_MEM_DP_likwid.sh +echo " srun --cpus-per-task=$((cores)) likwid-perfctr -f -m -C E:N:\$m -g MEM_DP -o \$output_file ./../../build/gmgpolar --verbose $verbose --paraview $paraview --maxOpenMPThreads \$m --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance" >> run_COMPACT_MEM_DP_likwid.sh +echo "done;" >> run_COMPACT_MEM_DP_likwid.sh +### --------------------------------------- ### + + + +### --------------------------------- ### +### Build run_SPREAD_FLOPS_DP_likwid.sh file ### +echo "#!/bin/bash" > run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH --job-name=FLOPS_DP" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH --output=../slurm_output/slurm-%A-SPREAD-FLOPS_DP-geom$geometry-prob$problem.out" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH --error=../slurm_output/slurm-%A-SPREAD-FLOPS_DP-geom$geometry-prob$problem.err" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH -N $nodes" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH -n $ranks" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH -c $cores" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH --threads-per-core=1" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH --cpu-freq=1800000" >> run_SPREAD_FLOPS_DP_likwid.sh +echo '#SBATCH --nodelist="be-cpu02"' >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH -t 1440" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "#SBATCH --exclusive" >> run_SPREAD_FLOPS_DP_likwid.sh + +echo "" >> run_SPREAD_FLOPS_DP_likwid.sh + +echo "# potentially run benchmark on machine" >> run_SPREAD_FLOPS_DP_likwid.sh +echo "# srun --cpus-per-task=$((cores)) likwid-bench -i 1000 -t stream_avx_fma -w S0:500MB:64" >> run_SPREAD_FLOPS_DP_likwid.sh + +echo "" >> run_SPREAD_FLOPS_DP_likwid.sh + +echo "core_list=( ${core_list[@]} )" >> run_SPREAD_FLOPS_DP_likwid.sh + +for m in ${core_list[@]}; do + + list=() + for ((s=0; s> run_SPREAD_FLOPS_DP_likwid.sh +done +### --------------------------------- ### + + +### ------------------------------- ### +### Build run_SPREAD_MEM_DP_likwid.sh file ### +echo "#!/bin/bash" > run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH --job-name=MEM_DP" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH --output=../slurm_output/slurm-%A-SPREAD-MEM_DP-geom$geometry-prob$problem.out" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH --error=../slurm_output/slurm-%A-SPREAD-MEM_DP-geom$geometry-prob$problem.err" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH -N $nodes" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH -n $ranks" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH -c $cores" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH --threads-per-core=1" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH --cpu-freq=1800000" >> run_SPREAD_MEM_DP_likwid.sh +echo '#SBATCH --nodelist="be-cpu02"' >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH -t 1440" >> run_SPREAD_MEM_DP_likwid.sh +echo "#SBATCH --exclusive" >> run_SPREAD_MEM_DP_likwid.sh + +echo "" >> run_SPREAD_MEM_DP_likwid.sh + + +echo "# potentially run benchmark on machine" >> run_SPREAD_MEM_DP_likwid.sh +echo "# srun --cpus-per-task=$((cores)) likwid-bench -i 1000 -t stream_avx_fma -w S0:500MB:64" >> run_SPREAD_MEM_DP_likwid.sh + +echo "" >> run_SPREAD_MEM_DP_likwid.sh + +echo "core_list=( ${core_list[@]} )" >> run_SPREAD_MEM_DP_likwid.sh +for m in ${core_list[@]}; do + + list=() + for ((s=0; s> run_SPREAD_MEM_DP_likwid.sh +done +### ------------------------------- ### + + +### ---------------- ### +### Start Benchmarks ### +sbatch run_COMPACT_FLOPS_DP_likwid.sh +sbatch run_SPREAD_FLOPS_DP_likwid.sh +sbatch run_COMPACT_MEM_DP_likwid.sh +sbatch run_SPREAD_MEM_DP_likwid.sh +### ---------------- ### diff --git a/scripts/roofline_model/peak_performance.sh b/scripts/roofline_model/peak_performance.sh new file mode 100644 index 00000000..6cd5be43 --- /dev/null +++ b/scripts/roofline_model/peak_performance.sh @@ -0,0 +1,35 @@ +#!/bin/bash +#SBATCH --job-name=RoofLine +#SBATCH --output=slurm-%A-Roofline-Model.out +#SBATCH --error=slurm-%A-Roofline-Model.err +#SBATCH -N 1 +#SBATCH -n 1 +#SBATCH -c 56 +#SBATCH --threads-per-core=1 +#SBATCH --nodelist="be-cpu03" +#SBATCH -t 1440 +#SBATCH --exclusive + +srun likwid-topology + +# CPU name: Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz +# CPU type: Intel Skylake SP processor +# CPU stepping: 4 +# Sockets: 4 +# Cores per socket: 14 +# Threads per core: 1 +# Level 1: 32 kB +# Level 2: 1 MB +# Level 3: 19 MB +# NUMA domains: 4 + +# So we have 4 x 14 hardware threads on this machine. +# We use a stream size of 4 x 14 x 32 kB = 1792 kB, +# 32kB for each of the 56 hardware threads so that each vector chunk fits into the L1 cache of one core. + +# Upper Peak GFLOPS Estimate: 2.6 GHz x 32 FLOPS/cycle x 56 cores = 4659.2 GFLOPS +srun likwid-bench -t peakflops_avx -W N:1792kB:56 # GFlops/s: 1256.6 +# Remark: peakflops_avx512 is not available + +# Bandwidth according to cluster documentation: GByte/s: 281.0 +srun likwid-bench -t load_avx512 -W N:2GB:56 # GByte/s: 355.6 diff --git a/scripts/roofline_model/roofline_model.py b/scripts/roofline_model/roofline_model.py new file mode 100644 index 00000000..39276575 --- /dev/null +++ b/scripts/roofline_model/roofline_model.py @@ -0,0 +1,144 @@ +import matplotlib.pyplot as plt +import numpy as np +from matplotlib.lines import Line2D + +### Data ### +title = "Roofline Model - Czarny Geometry" +x_axis_label = "Operational Intensity [FLOPS/Byte]" +y_axis_label = "Performance [GFLOPS]" +# Measured by Likwid +# maximum_performance = 1256.6 * 1000 # Maximum performance in MFLOP/s +# maximum_bandwidth = 355.6 * 1000 # Maximum bandwidth in MByte/s +# Given in cluster documentation +maximum_performance = 2.6 * 32 * 56 * 1000 +maximum_bandwidth = 281.0 * 1000 + +### Start Plotting ### +x_min = 1/8 +x_max = 128 +x_ticks = [1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64, 128] +x_tick_labels = ["1/8", "1/4", "1/2", "1", "2", "4", "8", "16", "32", "64", "128"] + +y_min = 1 +y_max = 16384 +y_ticks = [1, 4, 16, 64, 256, 1024, 4096, 16384] +y_tick_labels = [f"{int(tick)}" for tick in y_ticks] + +# Convert maximum performance to GFLOPS and maximum bandwidth to GB/s +max_perf_gflops = maximum_performance / 1000 # GFLOPS +max_bw_gbs = maximum_bandwidth / 1000 # GB/s + +# Operational intensity (OI) range for the plot +oi = np.logspace(np.log10(x_min), np.log10(x_max), 500) + +# Roofline calculations +# Memory-bound (Bandwidth roofline) +memory_bound = max_bw_gbs * oi + +# Performance-bound (Compute roofline) +performance_bound = np.full_like(oi, max_perf_gflops) + +# Intersection point between memory and compute roofs +intersection_oi = max_perf_gflops / max_bw_gbs + +# Plot +plt.figure(figsize=(6, 7)) + +# Memory Bound +x1 = np.array([0, intersection_oi]) +y1 = np.array([0, max_perf_gflops]) +plt.loglog(x1, y1, 'k-', label="_nolegend_") +# Computation Bound +x1 = np.array([intersection_oi, x_max]) +y1 = np.array([max_perf_gflops, max_perf_gflops]) +plt.loglog(x1, y1, 'k-', label="_nolegend_") + +### No SIMD line ### +no_simd = 2.6 * 56 +intersection_no_simd = no_simd / max_bw_gbs +x1 = np.array([intersection_no_simd, x_max]) +y1 = np.array([no_simd, no_simd]) +plt.loglog(x1, y1, 'g-', label="_nolegend_") # Green line + +# Add text above the NO SIMD line +plt.text( + intersection_no_simd + 20, # X position, slightly to the right of the intersection + no_simd * 1.1, # Y position, a bit above the line + 'no SIMD', # Text label + color='green', # Text color (match the line color) + fontsize=12, # Font size + verticalalignment='bottom', # Vertical alignment (place text above the line) + horizontalalignment='left' # Horizontal alignment (adjust to the left) +) + + +# Serial Line in Purple +serial = 2.6 +intersection_serial = serial / max_bw_gbs +x1 = np.array([intersection_serial, x_max]) +y1 = np.array([serial, serial]) +plt.loglog(x1, y1, color='purple', linestyle='-', label="_nolegend_") + +# Add text above the NO SIMD line (Purple) +plt.text( + intersection_serial + 25, # X position, slightly to the right of the intersection + serial * 1.1, # Y position, a bit above the line + 'serial', # Text label + color='purple', # Text color (match the line color) + fontsize=12, # Font size + verticalalignment='bottom', # Vertical alignment (place text above the line) + horizontalalignment='left' # Horizontal alignment (adjust to the left) +) + + +data = [ + # [op_ins, app_perf, color, shape] + [57.6606, 32448.0051, 'g', 'o'], # Give (769 x 1024) + [26.4743, 51214.0858, 'b', 'o'], # Give (1537 x 2048) + [9.4655, 67896.1025, 'orange', 'o'], # Give (3073 x 4096) + [6.3435, 79118.8143, 'r', 'o'], # Give (6145 x 8192) + [32.5134, 16787.3805, 'g', '^'], # Take (769 x 1024) + [4.9066, 28809.3174, 'b', '^'], # Take (1537 x 2048) + [3.2515, 45878.1637, 'orange', '^'], # Take (3073 x 4096) + [2.9040, 54252.0375, 'r', '^'], # Take (6145 x 8192) +] + +for op_ins, app_perf, color, shape in data: + plt.plot(op_ins, app_perf / 1000, marker=shape, color=color, linestyle='None') + +### Custom legend ### +# Legend elements for shapes (methods) +shape_legend = [ + Line2D([0], [0], color='black', marker='o', linestyle='None', label='Method: Give'), + Line2D([0], [0], color='black', marker='^', linestyle='None', label='Method: Take'), +] + +# Legend elements for colors (size configurations) +color_legend = [ + Line2D([0], [0], color='g', marker='o', linestyle='None', label='Size: 769 x 1024'), + Line2D([0], [0], color='b', marker='o', linestyle='None', label='Size: 1537 x 2048'), + Line2D([0], [0], color='orange', marker='o', linestyle='None', label='Size: 3073 x 4096'), + Line2D([0], [0], color='r', marker='o', linestyle='None', label='Size: 6145 x 8192'), +] + + +# Labels and grid +plt.title(title) +plt.xlabel(x_axis_label) +plt.ylabel(y_axis_label) +plt.xticks(x_ticks, x_tick_labels) +plt.yticks(y_ticks, y_tick_labels) + +# Set axis limits +plt.xlim(x_min, x_max) +plt.ylim(y_min, y_max) + +# Legend +plt.legend(handles= shape_legend + color_legend, loc='lower left') + +# Show plot +plt.tight_layout() +plt.show() + + +plt.savefig('roofline_model.png') \ No newline at end of file diff --git a/scripts/scalability/strong_scaling/plot_strong_scaling.py b/scripts/scalability/strong_scaling/plot_strong_scaling.py new file mode 100644 index 00000000..dbc365cb --- /dev/null +++ b/scripts/scalability/strong_scaling/plot_strong_scaling.py @@ -0,0 +1,339 @@ + + +# import pandas as pd +# import matplotlib.pyplot as plt + +# # Load the strong scaling results from CSV +# data = pd.read_csv('strong_scaling_results.csv') + +# # Define the number of sockets and socket size +# sockets = 4 +# socket_size = 14 + +# # Calculate the total number of threads +# total_threads = sockets * socket_size # 2 * 24 = 48 + +# # Function to calculate divisors +# def get_divisors(n): +# """Return the list of divisors of n.""" +# divisors = [] +# for i in range(1, n + 1): +# if n % i == 0: +# divisors.append(i) +# return divisors + +# # Get all divisors of total_threads +# divisors = get_divisors(total_threads) + +# nr = data["nr"][0] +# ntheta = data["ntheta"][0] +# geometry_name = data["geometry"][0] + +# # Create the plot +# plt.figure(figsize=(12, 8)) + +# # Define the colors for each component +# colors = { +# 'Total': '#d62728', # Total in red +# 'Smoothing': '#ff7f0e', # Smoothing in orange +# 'Residual': '#1f77b4', # Residual in blue +# 'Direct Solver': '#2ca02c' # Direct Solver in green +# } +# # Plot the times with the chosen colors for each component +# plt.plot(data['Threads'], data['t_avg_MGC_total'], marker='o', label='Multigrid Cycle (Total)', color=colors['Total'], linewidth=2) +# plt.plot(data['Threads'], data['t_avg_MGC_preSmoothing'] + data['t_avg_MGC_postSmoothing'], marker='o', label='Smoothing', color=colors['Smoothing'], linewidth=2) +# plt.plot(data['Threads'], data['t_avg_MGC_residual'], marker='o', label='Residual', color=colors['Residual'], linewidth=2) +# plt.plot(data['Threads'], data['t_avg_MGC_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +# # Calculate and plot the optimal scaling line +# initial_time = data['t_avg_MGC_total'][0] # First value in TotalTime (with the fewest threads) +# optimal_times = [initial_time / t for t in data['Threads']] # Ideal scaling times + +# # Plot the optimal line +# plt.plot(data['Threads'], optimal_times, 'k--', label='__no_legend__') + +# # Set x-axis to logarithmic scale +# plt.xscale('log') + +# # Set x-axis ticks to the calculated divisors, limiting them to a few key ones +# plt.xticks(divisors, labels=[str(d) for d in divisors if d <= total_threads]) + +# # Add vertical lines at multiples of socket_size +# plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) +# for i in range(1, sockets + 1): # 1 to number of sockets +# x_position = i * socket_size +# plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + +# # Labels and title +# plt.yscale('log') +# plt.xlabel('Number of Threads') +# plt.ylabel('Execution Time [s]') +# plt.title(f'Parallel Performance - {geometry_name} Geometry ({nr} x {ntheta})') +# plt.legend(loc='upper right', frameon=False) + +# plt.grid(True, which="both", ls="--", linewidth=0.5) +# plt.savefig('image_strong_scaling.png') + +# # Show the plot +# plt.show() + + + + + + + + + + + + + + + + + + + + +import pandas as pd +import matplotlib.pyplot as plt + +# Load the strong scaling results from CSV +data = pd.read_csv('strong_scaling_results.csv') + +# Define the number of sockets and socket size +sockets = 4 +socket_size = 14 + +# Calculate the total number of threads +total_threads = sockets * socket_size # 2 * 24 = 48 + +# Function to calculate divisors +def get_divisors(n): + """Return the list of divisors of n.""" + divisors = [] + for i in range(1, n + 1): + if n % i == 0: + divisors.append(i) + return divisors + +# Get all divisors of total_threads +divisors = get_divisors(total_threads) + +nr = data["nr"][0] +ntheta = data["ntheta"][0] +geometry_name = data["geometry"][0] + +### General Plot ### + +plt.figure(figsize=(12, 8)) + +colors = { + 'Total Solve': '#d62728', + 'Multigrid Iterations': '#ff7f0e', + 'Check Convergence': '#1f77b4', + 'Total Setup': '#2ca02c', + 'Initial Approximation': 'gray' +} + +plt.plot(data['Threads'], data['t_solve_total'], marker='o', label='Solve (Total)', color=colors['Total Solve'], linewidth=2) +plt.plot(data['Threads'], data['t_solve_multigrid_iterations'], marker='o', label='Multigrid Iterations', color=colors['Multigrid Iterations'], linewidth=2) +plt.plot(data['Threads'], data['t_check_convergence'], marker='o', label='Check Convergence', color=colors['Check Convergence'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_total'], marker='o', label='Setup (Total)', color=colors['Total Setup'], linewidth=2) +if data["FMG"][0] > 0: + plt.plot(data['Threads'], data['t_solve_initial_approximation'], marker='o', label='Initial Approximation', color=colors['Initial Approximation'], linewidth=2) + +initial_time = data['t_solve_total'][0] # First value in TotalTime (with the fewest threads) +optimal_times = [initial_time / t for t in data['Threads']] # Ideal scaling times + +# Plot the optimal line +plt.plot(data['Threads'], optimal_times, 'k--', label='__no_legend__') + +# Set x-axis to logarithmic scale +plt.xscale('log') +plt.yscale('log') + +# Set x-axis ticks to the calculated divisors, limiting them to a few key ones +plt.xticks(divisors, labels=[str(d) for d in divisors if d <= total_threads]) + +# Add vertical lines at multiples of socket_size +plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) +for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + +# Labels and title +plt.yscale('log') +plt.xlabel('Number of Threads') +plt.ylabel('Execution Time [s]') +plt.title(f'Strong Scalability - {geometry_name} Geometry ({nr} x {ntheta}) - Method: {data["stencil_method"][0]}') + +plt.legend(loc='upper right', frameon=False) + +plt.grid(True, which="both", ls="--", linewidth=0.5) +plt.savefig('image_strong_scaling.png') + +### Multigrid Cycle Plot ### + +plt.figure(figsize=(12, 8)) + +colors = { + 'Total': '#d62728', + 'Smoothing': '#ff7f0e', + 'Residual': '#1f77b4', + 'Direct Solver': '#2ca02c' +} + +plt.plot(data['Threads'], data['t_avg_MGC_total'], marker='o', label='Multigrid Cycle (Total)', color=colors['Total'], linewidth=2) +plt.plot(data['Threads'], data['t_avg_MGC_preSmoothing'] + data['t_avg_MGC_postSmoothing'], marker='o', label='Smoothing', color=colors['Smoothing'], linewidth=2) +plt.plot(data['Threads'], data['t_avg_MGC_residual'], marker='o', label='Residual', color=colors['Residual'], linewidth=2) +plt.plot(data['Threads'], data['t_avg_MGC_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +initial_time = data['t_avg_MGC_total'][0] # First value in TotalTime (with the fewest threads) +optimal_times = [initial_time / t for t in data['Threads']] # Ideal scaling times + +# Plot the optimal line +plt.plot(data['Threads'], optimal_times, 'k--', label='__no_legend__') + +# Set x-axis to logarithmic scale +plt.xscale('log') +plt.yscale('log') + +# Set x-axis ticks to the calculated divisors, limiting them to a few key ones +plt.xticks(divisors, labels=[str(d) for d in divisors if d <= total_threads]) + +# Add vertical lines at multiples of socket_size +plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) +for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + +# Labels and title +plt.yscale('log') +plt.xlabel('Number of Threads') +plt.ylabel('Execution Time [s]') +plt.title(f'Strong Scalability: Multigrid Cycle - {geometry_name} Geometry ({nr} x {ntheta}) - Method: {data["stencil_method"][0]}') + +plt.legend(loc='upper right', frameon=False) + +plt.grid(True, which="both", ls="--", linewidth=0.5) +plt.savefig('image_strong_scaling_MGC.png') + +### Setup Plot ### + +plt.figure(figsize=(12, 8)) + +colors = { + 'Total': '#d62728', + 'Create Levels': '#ff7f0e', + 'Smoother': '#1f77b4', + 'Direct Solver': '#2ca02c' +} + +plt.plot(data['Threads'], data['t_setup_total'], marker='o', label='Setup (Total)', color=colors['Total'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_createLevels'], marker='o', label='Create Levels', color=colors['Create Levels'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_smoother'], marker='o', label='Smoother', color=colors['Smoother'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +initial_time = data['t_setup_total'][0] # First value in TotalTime (with the fewest threads) +optimal_times = [initial_time / t for t in data['Threads']] # Ideal scaling times + +# Plot the optimal line +plt.plot(data['Threads'], optimal_times, 'k--', label='__no_legend__') + +# Set x-axis to logarithmic scale +plt.xscale('log') +plt.yscale('log') + +# Set x-axis ticks to the calculated divisors, limiting them to a few key ones +plt.xticks(divisors, labels=[str(d) for d in divisors if d <= total_threads]) + +# Add vertical lines at multiples of socket_size +plt.axvline(x=1, color='darkgray', linestyle='--', linewidth=1.5) +for i in range(1, sockets + 1): # 1 to number of sockets + x_position = i * socket_size + plt.axvline(x=x_position, color='darkgray', linestyle='--', linewidth=1.5) + +# Labels and title +plt.yscale('log') +plt.xlabel('Number of Threads') +plt.ylabel('Execution Time [s]') +plt.title(f'Strong Scalability: Setup - {geometry_name} Geometry ({nr} x {ntheta}) - Method: {data["stencil_method"][0]}') + +plt.legend(loc='upper right', frameon=False) + +plt.grid(True, which="both", ls="--", linewidth=0.5) +plt.savefig('image_strong_scaling_Setup.png') + + + + +# plt.xticks(data['Threads'].unique(), labels=[str(int(t)) for t in data['Threads'].unique()]) + +# plt.xlabel('Number of Threads') +# plt.ylabel('Execution Time [s]') +# plt.title(f'Weak Scaling - Geometry: {geometry_name} - Method: {data["stencil_method"][0]} - Mesh Sizes: ({nr_small}x{ntheta_small}) → ({nr_large}x{ntheta_large})') + +# plt.legend(loc='lower right', frameon=False) +# plt.grid(True, which="both", ls="--", linewidth=0.5) +# plt.savefig('image_weak_scaling.png') + +# ### Multigrid Cycle Plot ### + +# plt.figure(figsize=(12, 8)) + +# colors = { +# 'Total': '#d62728', +# 'Smoothing': '#ff7f0e', +# 'Residual': '#1f77b4', +# 'Direct Solver': '#2ca02c' +# } + +# plt.plot(data['Threads'], data['t_avg_MGC_total'], marker='o', label='Multigrid Cycle (Total)', color=colors['Total'], linewidth=2) +# plt.plot(data['Threads'], data['t_avg_MGC_preSmoothing'] + data['t_avg_MGC_postSmoothing'], marker='o', label='Smoothing', color=colors['Smoothing'], linewidth=2) +# plt.plot(data['Threads'], data['t_avg_MGC_residual'], marker='o', label='Residual', color=colors['Residual'], linewidth=2) +# plt.plot(data['Threads'], data['t_avg_MGC_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +# plt.xscale('log') +# plt.yscale('log') + +# plt.xticks(data['Threads'].unique(), labels=[str(int(t)) for t in data['Threads'].unique()]) + +# plt.xlabel('Number of Threads') +# plt.ylabel('Execution Time [s]') +# plt.title(f'Weak Scaling: Multigrid Cycle - Geometry: {geometry_name} - Method: {data["stencil_method"][0]} - Mesh Sizes: ({nr_small}x{ntheta_small}) → ({nr_large}x{ntheta_large})') + +# plt.legend(loc='lower right', frameon=False) +# plt.grid(True, which="both", ls="--", linewidth=0.5) +# plt.savefig('image_weak_scaling_MGC.png') + +# ### Setup Plot ### + +# plt.figure(figsize=(12, 8)) + +# colors = { +# 'Total': '#d62728', +# 'Create Levels': '#ff7f0e', +# 'Smoother': '#1f77b4', +# 'Direct Solver': '#2ca02c' +# } + +# plt.plot(data['Threads'], data['t_setup_total'], marker='o', label='Setup (Total)', color=colors['Total'], linewidth=2) +# plt.plot(data['Threads'], data['t_setup_createLevels'], marker='o', label='Create Levels', color=colors['Create Levels'], linewidth=2) +# plt.plot(data['Threads'], data['t_setup_smoother'], marker='o', label='Smoother', color=colors['Smoother'], linewidth=2) +# plt.plot(data['Threads'], data['t_setup_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +# plt.xscale('log') +# plt.yscale('log') + +# plt.xticks(data['Threads'].unique(), labels=[str(int(t)) for t in data['Threads'].unique()]) + +# plt.xlabel('Number of Threads') +# plt.ylabel('Execution Time [s]') +# plt.title(f'Weak Scaling: Setup - Geometry: {geometry_name} - Method: {data["stencil_method"][0]} - Mesh Sizes: ({nr_small}x{ntheta_small}) → ({nr_large}x{ntheta_large})') + +# plt.legend(loc='lower right', frameon=False) +# plt.grid(True, which="both", ls="--", linewidth=0.5) +# plt.savefig('image_weak_scaling_Setup.png') + diff --git a/scripts/scalability/strong_scaling/start_strong_scaling_benchmark.sh b/scripts/scalability/strong_scaling/start_strong_scaling_benchmark.sh new file mode 100755 index 00000000..868bc0bb --- /dev/null +++ b/scripts/scalability/strong_scaling/start_strong_scaling_benchmark.sh @@ -0,0 +1,15 @@ +#!/bin/bash +#SBATCH --job-name=gmgpolar +#SBATCH --output=../../slurm_output/slurm-%A-Strong-Scaling-Benchmark.out +#SBATCH --error=../../slurm_output/slurm-%A-Strong-Scaling-Benchmark.err +#SBATCH -N 1 +#SBATCH -n 1 +#SBATCH -c 56 +#SBATCH --threads-per-core=1 +#SBATCH -t 1400 +# #SBATCH --nodelist="be-cpu02" +#SBATCH --exclusive + +# Adjust parameters in src/strong_scaling.cpp + +srun --cpus-per-task=56 ./../../../build/strong_scaling diff --git a/scripts/scalability/weak_scaling/plot_weak_scaling.py b/scripts/scalability/weak_scaling/plot_weak_scaling.py new file mode 100644 index 00000000..9fd45dbf --- /dev/null +++ b/scripts/scalability/weak_scaling/plot_weak_scaling.py @@ -0,0 +1,103 @@ +import pandas as pd +import matplotlib.pyplot as plt + +# Load the weak scaling results from CSV +data = pd.read_csv('weak_scaling_results.csv') + +nr_small = data["nr"][0] +ntheta_small = data["ntheta"][0] +nr_large = data["nr"].iloc[-1] +ntheta_large = data["ntheta"].iloc[-1] +geometry_name = data["geometry"][0] + +### General Plot ### + +plt.figure(figsize=(12, 8)) + +colors = { + 'Total Solve': '#d62728', + 'Multigrid Iterations': '#ff7f0e', + 'Check Convergence': '#2ca02c', + 'Total Setup': '#1f77b4', + 'Initial Approximation': 'gray' +} + +plt.plot(data['Threads'], data['t_solve_total'], marker='o', label='Solve (Total)', color=colors['Total Solve'], linewidth=2) +plt.plot(data['Threads'], data['t_solve_multigrid_iterations'], marker='o', label='Multigrid Iterations', color=colors['Multigrid Iterations'], linewidth=2) +plt.plot(data['Threads'], data['t_check_convergence'], marker='o', label='Check Convergence', color=colors['Check Convergence'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_total'], marker='o', label='Setup (Total)', color=colors['Total Setup'], linewidth=2) +if data["FMG"][0] > 0: + plt.plot(data['Threads'], data['t_solve_initial_approximation'], marker='o', label='Initial Approximation', color=colors['Initial Approximation'], linewidth=2) + + +plt.xscale('log') +plt.yscale('log') + +plt.xticks(data['Threads'].unique(), labels=[str(int(t)) for t in data['Threads'].unique()]) + +plt.xlabel('Number of Threads') +plt.ylabel('Execution Time [s]') +plt.title(f'Weak Scaling - Geometry: {geometry_name} - Method: {data["stencil_method"][0]} - Mesh Sizes: ({nr_small}x{ntheta_small}) → ({nr_large}x{ntheta_large})') + +plt.legend(loc='lower right', frameon=False) +plt.grid(True, which="both", ls="--", linewidth=0.5) +plt.savefig('image_weak_scaling.png') + +### Multigrid Cycle Plot ### + +plt.figure(figsize=(12, 8)) + +colors = { + 'Total': '#d62728', + 'Smoothing': '#ff7f0e', + 'Residual': '#1f77b4', + 'Direct Solver': '#2ca02c' +} + +plt.plot(data['Threads'], data['t_avg_MGC_total'], marker='o', label='Multigrid Cycle (Total)', color=colors['Total'], linewidth=2) +plt.plot(data['Threads'], data['t_avg_MGC_preSmoothing'] + data['t_avg_MGC_postSmoothing'], marker='o', label='Smoothing', color=colors['Smoothing'], linewidth=2) +plt.plot(data['Threads'], data['t_avg_MGC_residual'], marker='o', label='Residual', color=colors['Residual'], linewidth=2) +plt.plot(data['Threads'], data['t_avg_MGC_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +plt.xscale('log') +plt.yscale('log') + +plt.xticks(data['Threads'].unique(), labels=[str(int(t)) for t in data['Threads'].unique()]) + +plt.xlabel('Number of Threads') +plt.ylabel('Execution Time [s]') +plt.title(f'Weak Scaling: Multigrid Cycle - Geometry: {geometry_name} - Method: {data["stencil_method"][0]} - Mesh Sizes: ({nr_small}x{ntheta_small}) → ({nr_large}x{ntheta_large})') + +plt.legend(loc='lower right', frameon=False) +plt.grid(True, which="both", ls="--", linewidth=0.5) +plt.savefig('image_weak_scaling_MGC.png') + +### Setup Plot ### + +plt.figure(figsize=(12, 8)) + +colors = { + 'Total': '#d62728', + 'Create Levels': '#ff7f0e', + 'Smoother': '#1f77b4', + 'Direct Solver': '#2ca02c' +} + +plt.plot(data['Threads'], data['t_setup_total'], marker='o', label='Setup (Total)', color=colors['Total'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_createLevels'], marker='o', label='Create Levels', color=colors['Create Levels'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_smoother'], marker='o', label='Smoother', color=colors['Smoother'], linewidth=2) +plt.plot(data['Threads'], data['t_setup_directSolver'], marker='o', label='Direct Solver', color=colors['Direct Solver'], linewidth=2) + +plt.xscale('log') +plt.yscale('log') + +plt.xticks(data['Threads'].unique(), labels=[str(int(t)) for t in data['Threads'].unique()]) + +plt.xlabel('Number of Threads') +plt.ylabel('Execution Time [s]') +plt.title(f'Weak Scaling: Setup - Geometry: {geometry_name} - Method: {data["stencil_method"][0]} - Mesh Sizes: ({nr_small}x{ntheta_small}) → ({nr_large}x{ntheta_large})') + +plt.legend(loc='lower right', frameon=False) +plt.grid(True, which="both", ls="--", linewidth=0.5) +plt.savefig('image_weak_scaling_Setup.png') + diff --git a/scripts/scalability/weak_scaling/start_weak_scaling_benchmark.sh b/scripts/scalability/weak_scaling/start_weak_scaling_benchmark.sh new file mode 100644 index 00000000..64d52481 --- /dev/null +++ b/scripts/scalability/weak_scaling/start_weak_scaling_benchmark.sh @@ -0,0 +1,15 @@ +#!/bin/bash +#SBATCH --job-name=gmgpolar +#SBATCH --output=../../slurm_output/slurm-%A-Weak-Scaling-Benchmark.out +#SBATCH --error=../../slurm_output/slurm-%A-Weak-Scaling-Benchmark.err +#SBATCH -N 1 +#SBATCH -n 1 +#SBATCH -c 56 +#SBATCH --threads-per-core=1 +#SBATCH -t 1400 +# #SBATCH --nodelist="be-cpu02" +#SBATCH --exclusive + +# Adjust parameters in src/weak_scaling.cpp + +srun --cpus-per-task=56 ./../../../build/weak_scaling diff --git a/scripts/tutorial/convergence_order.sh b/scripts/tutorial/convergence_order.sh new file mode 100755 index 00000000..fa09bab9 --- /dev/null +++ b/scripts/tutorial/convergence_order.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Adjust parameters in src/convergence_order.cpp + +./../../build/convergence_order \ No newline at end of file diff --git a/scripts/tutorial/help.sh b/scripts/tutorial/help.sh new file mode 100755 index 00000000..914407cb --- /dev/null +++ b/scripts/tutorial/help.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./../../build/gmgpolar --help \ No newline at end of file diff --git a/scripts/tutorial/run.sh b/scripts/tutorial/run.sh new file mode 100755 index 00000000..0fc506f5 --- /dev/null +++ b/scripts/tutorial/run.sh @@ -0,0 +1,126 @@ +#!/bin/bash + +# Get the directory of the script +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Set path to the GMGPolar executable +GMGPOLAR_EXEC="${SCRIPT_DIR}/../../build/gmgpolar" + +# Verbosity level: +# 0 - No output +# 1 - Basic output +verbose=1 +# Set Paraview usage flag: +# 0 - Do not use Paraview +# 1 - Enable Paraview to visualize the grid, solution and error +paraview=0 + +# OpenMP settings: +# Maximum number of threads OpenMP can use for parallel execution +maxOpenMPThreads=32 +# Factor to reduce the number of threads OpenMP uses (e.g., 1.0 means no reduction) +threadReductionFactor=1.0 + +# Stencil distribution method: +# 0 - CPU "Take": Each node independently applies the stencil +# 1 - CPU "Give": The stencil operation is distributed across adjacent neighboring nodes +stencilDistributionMethod=1 +# Caching behavior: +# 0 - Recompute values on each iteration: Uses less memory but results in slower execution. +# 1 - Reuse cached values: Consumes more memory but significantly improves performance. +cacheDensityProfileCoefficients=1 +cacheDomainGeometry=0 +# Note: In the "Take" approach (stencilDistributionMethod=0), +# caching is required for optimal performance, +# so both density profile coefficients and domain geometry need to be cached. +if [[ $stencilDistributionMethod -eq 0 ]]; then + if [[ $cacheDensityProfileCoefficients -ne 1 || $cacheDomainGeometry -ne 1 ]]; then + echo "Error: Caching must be enabled (set to 1) for both density profile coefficients and domain geometry in 'Take' approach (stencilDistributionMethod=0)." + exit 1 + fi +fi + +# Finest grid parameters +R0=1e-8 +Rmax=1.3 +nr_exp=4 +ntheta_exp=-1 +anisotropic_factor=3 +divideBy2=3 + +# Finest grid can be loaded from a text file +write_grid_file=0 +load_grid_file=0 +file_grid_radii="_radii.txt" +file_grid_angles="_angles.txt" + +# Interior boundary condition: +# 0: Across-origin +# 1: u_D_Interior +DirBC_Interior=0 + +### Custom Test Cases ### +geometry=2 # Circular (0), Shafranov(1), Czarny(2), Culham (3) +problem=2 # CartesianR2(0), CartesianR6(1), PolarR6(2), RefinedRadius(3) +alpha_coeff=1 # Poisson(0), Sonnendrucker(1), Zoni(2), Zoni-Shifted(3) +beta_coeff=1 # Zero(0), Gyro - Alpha Inverse(1) +# Remark: For RefinedRadius choose alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry choose geometry=3, problem=2,3, alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry the provided exactSolution may be incorrect. + +# Full Multigrid Method: +# 0: Initial approximation is set to zero +# 1: Initial approximation obtained by nested iteration (recommended) +FMG=0 +FMG_iterations=3 +FMG_cycle=2 # V-Cycle(0), W-Cycle(1), F-Cycle(2) + +# Extrapolation Method: +# 0: No extrapolation +# 1: Implicit extrapolation (recommended) +# 2: Implicit extrapolation with full grid smoothing (residuals cannot be used as convergence criteria) +# 3: Combination of both implicit extrapolation methods (May be usefull for FMG=0) +extrapolation=1 +# Maximum number of multigrid levels: +maxLevels=7 +# Number of smoothing steps: +preSmoothingSteps=1 +postSmoothingSteps=1 +# Multigrid Cycle: +# 0: V-Cycle +# 1: W-Cycle +# 2: F-Cycle +multigridCycle=0 + +# Convergence criteria: +maxIterations=150 +residualNormType=0 # L2-Norm(0) = 0, Weighted L2-Norm(1), Infinity-Norm(2) +absoluteTolerance=1e-8 +relativeTolerance=1e-8 + +# Define additional geometry parameters +kappa_eps=0.0 +delta_e=0.0 +if [ "$geometry" -eq 1 ]; then + kappa_eps=0.3 + delta_e=0.2 +elif [ "$geometry" -eq 2 ]; then + kappa_eps=0.3 + delta_e=1.4 +fi + +# Set alpha_jump based on alpha_coeff value +# Used for anisotropic grid refinement -> refinement_radius +if [ "$alpha_coeff" -eq 0 ]; then + alpha_jump=$(python3 -c "print(0.5 * float($Rmax))") +elif [ "$alpha_coeff" -eq 1 ]; then + alpha_jump=$(python3 -c "print(0.66 * float($Rmax))") +elif [ "$alpha_coeff" -eq 2 ]; then + alpha_jump=$(python3 -c "print(0.4837 * float($Rmax))") +elif [ "$alpha_coeff" -eq 3 ]; then + alpha_jump=$(python3 -c "print(0.7081 * float($Rmax))") +else + echo "Invalid value for alpha_coeff: $alpha_coeff" + exit 1 +fi + +"$GMGPOLAR_EXEC" --verbose $verbose --paraview $paraview --maxOpenMPThreads $maxOpenMPThreads --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance diff --git a/scripts/tutorial/sbatch.sh b/scripts/tutorial/sbatch.sh new file mode 100644 index 00000000..d918891c --- /dev/null +++ b/scripts/tutorial/sbatch.sh @@ -0,0 +1,131 @@ +#!/bin/bash +#SBATCH --job-name=gmgpolar +#SBATCH --output=../slurm_output/slurm-%A-GMGPolar_Tutorial.out +#SBATCH --error=../slurm_output/slurm-%A-GMGPolar_Tutorial.err +#SBATCH -N 1 +#SBATCH -n 1 +#SBATCH -c 56 +#SBATCH --threads-per-core=1 +#SBATCH -t 1400 +# #SBATCH --nodelist="be-cpu01" +#SBATCH --exclusive + +# Verbosity level: +# 0 - No output +# 1 - Basic output +verbose=1 +# Set Paraview usage flag: +# 0 - Do not use Paraview +# 1 - Enable Paraview to visualize the grid, solution and error +paraview=0 + +# OpenMP settings: +# Maximum number of threads OpenMP for parallel execution +maxOpenMPThreads=20 +# Factor to reduce the number of threads OpenMP between levels (e.g., 1.0 means no reduction) +threadReductionFactor=1.0 + +# Implementation strategy: +# 0 - CPU "Take": Each node independently applies the stencil +# 1 - CPU "Give": The stencil operation is distributed across adjacent neighboring nodes +stencilDistributionMethod=0 +# Caching behavior: +# 0 - Recompute values on each iteration: Uses less memory but results in slower execution. +# 1 - Reuse cached values: Consumes more memory but significantly improves performance. +cacheDensityProfileCoefficients=1 +cacheDomainGeometry=1 +# Note: In the "Take" approach (stencilDistributionMethod=0), +# caching is required for optimal performance, +# so both density profile coefficients and domain geometry need to be cached. +if [[ $stencilDistributionMethod -eq 0 ]]; then + if [[ $cacheDensityProfileCoefficients -ne 1 || $cacheDomainGeometry -ne 1 ]]; then + echo "Error: Caching must be enabled (set to 1) for both density profile coefficients and domain geometry in 'Take' approach (stencilDistributionMethod=0)." + exit 1 + fi +fi + +# Finest grid parameters +R0=1e-8 +Rmax=1.0 +nr_exp=4 +ntheta_exp=-1 +anisotropic_factor=3 +divideBy2=5 + +# Finest grid can be loaded from a text file +write_grid_file=0 +load_grid_file=0 +file_grid_radii="_radii.txt" +file_grid_angles="_angles.txt" + +# Interior boundary condition: +# 0: Across-origin +# 1: u_D_Interior +DirBC_Interior=0 + +### Custom Test Cases ### +geometry=2 # Circular (0), Shafranov(1), Czarny(2), Culham (3) +problem=2 # CartesianR2(0), CartesianR6(1), PolarR6(2), RefinedRadius(3) +alpha_coeff=1 # Poisson(0), Sonnendrucker(1), Zoni(2), Zoni-Shifted(3) +beta_coeff=1 # Zero(0), Gyro - Alpha Inverse(1) +# Remark: For RefinedRadius choose alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry choose geometry=3, problem=2,3, alpha_coeff=3, beta_coeff=1 +# Remark: For Culham Geometry the provided exactSolution may be incorrect. + +# Full Multigrid Method: +# 0: Initial approximation is set to zero +# 1: Initial approximation obtained by nested iteration (recommended) +FMG=0 +FMG_iterations=3 +FMG_cycle=2 # V-Cycle(0), W-Cycle(1), F-Cycle(2) + +# Extrapolation Method: +# 0: No extrapolation +# 1: Implicit extrapolation (recommended) +# 2: Implicit extrapolation with full grid smoothing (residuals cannot be used as convergence criteria) +# 3: Combination of both implicit extrapolation methods (May be usefull for FMG=0) +extrapolation=0 +# Maximum number of multigrid levels: +maxLevels=6 +# Number of smoothing steps: +preSmoothingSteps=1 +postSmoothingSteps=1 +# Multigrid Cycle: +# 0: V-Cycle +# 1: W-Cycle +# 2: F-Cycle +multigridCycle=0 + +# Convergence criteria: +maxIterations=20 +residualNormType=0 # L2-Norm(0) = 0, Weighted L2-Norm(1), Infinity-Norm(2) +absoluteTolerance=1e-8 +relativeTolerance=1e-10 + +# Define additional geometry parameters +kappa_eps=0.0 +delta_e=0.0 +if [ "$geometry" -eq 1 ]; then + kappa_eps=0.3 + delta_e=0.2 +elif [ "$geometry" -eq 2 ]; then + kappa_eps=0.3 + delta_e=1.4 +fi + +# Set alpha_jump based on alpha_coeff value +# Used for anisotropic grid refinement -> refinement_radius +if [ "$alpha_coeff" -eq 0 ]; then + alpha_jump=$(echo "0.5 * $Rmax" | bc) +elif [ "$alpha_coeff" -eq 1 ]; then + alpha_jump=$(echo "0.66 * $Rmax" | bc) +elif [ "$alpha_coeff" -eq 2 ]; then + alpha_jump=$(echo "0.4837 * $Rmax" | bc) +elif [ "$alpha_coeff" -eq 3 ]; then + alpha_jump=$(echo "0.7081 * $Rmax" | bc) +else + echo "Invalid value for alpha_coeff: $alpha_coeff" + exit 1 +fi + +srun ./../../build/gmgpolar --verbose $verbose --paraview $paraview --maxOpenMPThreads $maxOpenMPThreads --threadReductionFactor $threadReductionFactor --stencilDistributionMethod $stencilDistributionMethod --cacheDensityProfileCoefficients $cacheDensityProfileCoefficients --cacheDomainGeometry $cacheDomainGeometry --R0 $R0 --Rmax $Rmax --nr_exp $nr_exp --ntheta_exp $ntheta_exp --anisotropic_factor $anisotropic_factor --divideBy2 $divideBy2 --write_grid_file $write_grid_file --load_grid_file $load_grid_file --file_grid_radii "$file_grid_radii" --file_grid_angles "$file_grid_angles" --DirBC_Interior $DirBC_Interior --geometry $geometry --kappa_eps $kappa_eps --delta_e $delta_e --problem $problem --alpha_coeff $alpha_coeff --alpha_jump $alpha_jump --beta_coeff $beta_coeff --FMG $FMG --FMG_iterations $FMG_iterations --FMG_cycle $FMG_cycle --extrapolation $extrapolation --maxLevels $maxLevels --preSmoothingSteps $preSmoothingSteps --postSmoothingSteps $postSmoothingSteps --multigridCycle $multigridCycle --maxIterations $maxIterations --residualNormType $residualNormType --absoluteTolerance $absoluteTolerance --relativeTolerance $relativeTolerance diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 214365f4..00000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -set(SRC_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/build_bi_aniso_rdir_phiper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/build_fd9star_anisotr_scaled.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/build_rhs_apply_op.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/create_grid_polar.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/define_coarse_nodes.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/direct_solve.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/gmgpolar.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/gyro.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/level.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/multigrid_iter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/polar_multigrid.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/prolongation.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/RHS.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/smoother.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/smoother0.cpp) - -set(SRC_TEST_CASES_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroSonnendruckerCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroSonnendruckerShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroSonnendruckerTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroZoniCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroZoniShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroZoniShiftedTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2GyroZoniTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2PoissonCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2PoissonShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2PoissonTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2SonnendruckerCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2SonnendruckerShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2SonnendruckerTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2ZoniCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2ZoniShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2ZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2ZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2ZoniShiftedTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR2ZoniTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroSonnendruckerCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroSonnendruckerShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroSonnendruckerTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroZoniCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroZoniShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroZoniShiftedTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6GyroZoniTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6PoissonCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6PoissonShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6PoissonTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6SonnendruckerCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6SonnendruckerShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6SonnendruckerTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6ZoniCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6ZoniShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6ZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6ZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6ZoniShiftedTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/CartesianR6ZoniTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroSonnendruckerCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroSonnendruckerShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroSonnendruckerTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniShiftedCulham.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniShiftedTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6GyroZoniTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6PoissonCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6PoissonShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6PoissonTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6SonnendruckerCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6SonnendruckerShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6SonnendruckerTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6ZoniCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6ZoniShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6ZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6ZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6ZoniShiftedTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/PolarR6ZoniTriangular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/RefinedGyroZoniShiftedCircular.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/RefinedGyroZoniShiftedCulham.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/RefinedGyroZoniShiftedShafranov.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_cases/RefinedGyroZoniShiftedTriangular.cpp -) - -set(SOURCES_SRC ${SRC_FILES} ${SRC_TEST_CASES_FILES} PARENT_SCOPE) \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGive/applySymmetryShift.cpp b/src/DirectSolver/DirectSolverGive/applySymmetryShift.cpp new file mode 100644 index 00000000..44873082 --- /dev/null +++ b/src/DirectSolver/DirectSolverGive/applySymmetryShift.cpp @@ -0,0 +1,162 @@ +#include "../../../include/DirectSolver/DirectSolverGive/directSolverGive.h" + +#include "../../../include/common/geometry_helper.h" + +#ifdef GMGPOLAR_USE_MUMPS + +/* ----------------------- */ +/* Boundary Symmetry Shift */ +/* ----------------------- */ + +void DirectSolverGive::applySymmetryShiftInnerBoundary(Vector& x) const +{ + assert(DirBC_Interior_); + + int i_r; + double r; + int global_index; + double h1, h2, k1, k2; + double coeff1, coeff2; + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const double theta = grid_.theta(i_theta); + /* -------------------------- */ + /* Node on the inner boundary */ + /* -------------------------- */ + i_r = 0; + r = grid_.radius(i_r); + global_index = grid_.index(i_r, i_theta); + + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + h2 = grid_.radialSpacing(i_r); + k1 = grid_.angularSpacing(i_theta - 1); + k2 = grid_.angularSpacing(i_theta); + + coeff2 = 0.5 * (k1 + k2) / h2; + + /* Fill x(i+1,j) */ + x[grid_.index(i_r + 1, i_theta)] -= -coeff2 * arr * x[grid_.index(i_r, i_theta)] /* Left */ + + 0.25 * art * x[grid_.index(i_r, i_theta + 1)] /* Top Left */ + - 0.25 * art * x[grid_.index(i_r, i_theta - 1)]; /* Bottom Left */ + + /* --------------------------- */ + /* Node next to inner boundary */ + /* --------------------------- */ + i_r = 1; + r = grid_.radius(i_r); + global_index = grid_.index(i_r, i_theta); + + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + h1 = grid_.radialSpacing(i_r - 1); + k1 = grid_.angularSpacing(i_theta - 1); + k2 = grid_.angularSpacing(i_theta); + + coeff1 = 0.5 * (k1 + k2) / h1; + + /* Fill x(i,j) */ + x[grid_.index(i_r, i_theta)] -= -coeff1 * arr * x[grid_.index(i_r - 1, i_theta)]; /* Left */ + /* Fill x(i,j-1) */ + x[grid_.index(i_r, i_theta - 1)] -= +0.25 * art * x[grid_.index(i_r - 1, i_theta)]; /* Top Left */ + /* Fill x(i,j+1) */ + x[grid_.index(i_r, i_theta + 1)] -= -0.25 * art * x[grid_.index(i_r - 1, i_theta)]; /* Bottom Left */ + } +} + +void DirectSolverGive::applySymmetryShiftOuterBoundary(Vector& x) const +{ + int i_r; + double r; + int global_index; + double h1, h2, k1, k2; + double coeff1, coeff2; + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const double theta = grid_.theta(i_theta); + /* --------------------------- */ + /* Node next to outer boundary */ + /* --------------------------- */ + i_r = grid_.nr() - 2; + r = grid_.radius(i_r); + global_index = grid_.index(i_r, i_theta); + + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + h2 = grid_.radialSpacing(i_r); + k1 = grid_.angularSpacing(i_theta - 1); + k2 = grid_.angularSpacing(i_theta); + + coeff2 = 0.5 * (k1 + k2) / h2; + + /* Fill result(i,j) */ + x[grid_.index(i_r, i_theta)] -= -coeff2 * arr * x[grid_.index(i_r + 1, i_theta)]; /* Right */ + /* Fill result(i,j-1) */ + x[grid_.index(i_r, i_theta - 1)] -= -0.25 * art * x[grid_.index(i_r + 1, i_theta)]; /* Top Right */ + /* Fill result(i,j+1) */ + x[grid_.index(i_r, i_theta + 1)] -= +0.25 * art * x[grid_.index(i_r + 1, i_theta)]; /* Bottom Right */ + + /* -------------------------- */ + /* Node on the outer boundary */ + /* -------------------------- */ + i_r = grid_.nr() - 1; + r = grid_.radius(i_r); + global_index = grid_.index(i_r, i_theta); + + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + h1 = grid_.radialSpacing(i_r - 1); + k1 = grid_.angularSpacing(i_theta - 1); + k2 = grid_.angularSpacing(i_theta); + + coeff1 = 0.5 * (k1 + k2) / h1; + + /* Fill result(i-1,j) */ + x[grid_.index(i_r - 1, i_theta)] -= -coeff1 * arr * x[grid_.index(i_r, i_theta)] /* Right */ + - 0.25 * art * x[grid_.index(i_r, i_theta + 1)] /* Top Right */ + + 0.25 * art * x[grid_.index(i_r, i_theta - 1)]; /* Bottom Right */ + } +} + +// clang-format off +void DirectSolverGive::applySymmetryShift(Vector& x) const +{ + assert(x.size() == grid_.numberOfNodes()); + assert(grid_.nr() >= 4); + + omp_set_num_threads(num_omp_threads_); + + if (num_omp_threads_ == 1) { + /* Single-threaded execution */ + if (DirBC_Interior_) { + applySymmetryShiftInnerBoundary(x); + } + applySymmetryShiftOuterBoundary(x); + } + else { + #pragma omp parallel sections + { + #pragma omp section + { + if (DirBC_Interior_) { + applySymmetryShiftInnerBoundary(x); + } + } + + #pragma omp section + { + applySymmetryShiftOuterBoundary(x); + } + } + } +} +// clang-format on +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGive/buildSolverMatrix.cpp b/src/DirectSolver/DirectSolverGive/buildSolverMatrix.cpp new file mode 100644 index 00000000..812bd099 --- /dev/null +++ b/src/DirectSolver/DirectSolverGive/buildSolverMatrix.cpp @@ -0,0 +1,929 @@ +#include "../../../include/DirectSolver/DirectSolverGive/directSolverGive.h" + +#include "../../../include/common/geometry_helper.h" + +#ifdef GMGPOLAR_USE_MUMPS + + #define UPDATE_MATRIX_ELEMENT(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_index(ptr + offset) = row; \ + matrix.col_index(ptr + offset) = col; \ + matrix.value(ptr + offset) += val; \ + } while (0) + + #define NODE_BUILD_SOLVER_MATRIX_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, \ + solver_matrix, arr, att, art, detDF, coeff_beta) \ + do { \ + int ptr, offset; \ + int row, col; \ + double val; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 1 && i_r < grid.nr() - 2) { \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta_M1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + const int left_nz_index = getSolverMatrixIndex(i_r - 1, i_theta); \ + const int right_nz_index = getSolverMatrixIndex(i_r + 1, i_theta); \ + const int bottom_nz_index = getSolverMatrixIndex(i_r, i_theta_M1); \ + const int top_nz_index = getSolverMatrixIndex(i_r, i_theta_P1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + ptr = left_nz_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + ptr = right_nz_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + ptr = bottom_nz_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopLeft]; \ + col = left_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + ptr = top_nz_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomLeft]; \ + col = left_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + /* -------------------------- */ \ + /* Node on the inner boundary */ \ + /* -------------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + const int right_nz_index = getSolverMatrixIndex(i_r + 1, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + ptr = right_nz_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + /* Left REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* TopLeft REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + /* BottomLeft REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + grid.ntheta()/2). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + assert(grid_.ntheta() % 2 == 0); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + grid.ntheta() / 2); \ + \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta_M1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + const int left_nz_index = getSolverMatrixIndex(i_r, i_theta_AcrossOrigin); \ + const int right_nz_index = getSolverMatrixIndex(i_r + 1, i_theta); \ + const int bottom_nz_index = getSolverMatrixIndex(i_r, i_theta_M1); \ + const int top_nz_index = getSolverMatrixIndex(i_r, i_theta_P1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r, i_theta_AcrossOrigin); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + /* From view the view of the across origin node, */ \ + /* the directions are roatated by 180 degrees in the stencil! */ \ + row = left_index; \ + ptr = left_nz_index; \ + \ + const Stencil& LeftStencil = CenterStencil; \ + \ + offset = LeftStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right -> Left*/ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) -> Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Top Right -> Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Bottom Right -> Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + ptr = right_nz_index; \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + ptr = bottom_nz_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* TopLeft REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + ptr = top_nz_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* BottomLeft REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + } \ + } \ + /* ------------------------------- */ \ + /* Node next to the inner boundary */ \ + /* ------------------------------- */ \ + else if (i_r == 1) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + const int left_nz_index = getSolverMatrixIndex(i_r - 1, i_theta); \ + const int right_nz_index = getSolverMatrixIndex(i_r + 1, i_theta); \ + const int bottom_nz_index = getSolverMatrixIndex(i_r, i_theta_M1); \ + const int top_nz_index = getSolverMatrixIndex(i_r, i_theta_P1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + if (!DirBC_Interior) { \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + if (!DirBC_Interior) { /* Don't give to the inner Dirichlet boundary! */ \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + ptr = left_nz_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + ptr = right_nz_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + ptr = bottom_nz_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + if (!DirBC_Interior) { \ + offset = BottomStencil[StencilPosition::TopLeft]; \ + col = left_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + ptr = top_nz_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + if (!DirBC_Interior) { \ + offset = TopStencil[StencilPosition::BottomLeft]; \ + col = left_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + } \ + /* ------------------------------- */ \ + /* Node next to the outer boundary */ \ + /* ------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + const int left_nz_index = getSolverMatrixIndex(i_r - 1, i_theta); \ + const int right_nz_index = getSolverMatrixIndex(i_r + 1, i_theta); \ + const int bottom_nz_index = getSolverMatrixIndex(i_r, i_theta_M1); \ + const int top_nz_index = getSolverMatrixIndex(i_r, i_theta_P1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Right REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + ptr = left_nz_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = 0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + /* Don't give to the outer dirichlet boundary! */ \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + ptr = bottom_nz_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* TopRight REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = BottomStencil[StencilPosition::TopLeft]; \ + col = left_index; \ + val = 0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + ptr = top_nz_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* BottomRight REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = TopStencil[StencilPosition::BottomLeft]; \ + col = left_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + /* ------------------------------------ */ \ + /* Node on the outer dirichlet boundary */ \ + /* ------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + const int left_nz_index = getSolverMatrixIndex(i_r - 1, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Give value to the interior nodes! */ \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + ptr = left_nz_index; \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + /* Right REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* TopRight REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + /* BottomRight REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + } \ + } while (0) + +void DirectSolverGive::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO& solver_matrix) +{ + const double r = grid_.radius(i_r); + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int global_index = grid_.index(i_r, i_theta); + const double theta = grid_.theta(i_theta); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + solver_matrix, arr, att, art, detDF, coeff_beta); + } +} + +void DirectSolverGive::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCOO& solver_matrix) +{ + const double theta = grid_.theta(i_theta); + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int global_index = grid_.index(i_r, i_theta); + const double r = grid_.radius(i_r); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + solver_matrix, arr, att, art, detDF, coeff_beta); + } +} + +// clang-format off + +/* ------------------------------------------------------------------------ */ +/* If the indexing is not smoother-based, please adjust the access patterns */ +SparseMatrixCOO DirectSolverGive::buildSolverMatrix() +{ + omp_set_num_threads(num_omp_threads_); + + const int n = grid_.numberOfNodes(); + const int nnz = getNonZeroCountSolverMatrix(); + + // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. + SparseMatrixCOO solver_matrix(n, n, nnz); + solver_matrix.is_symmetric(false); + + #pragma omp parallel for if (nnz > 10'000) + for (int i = 0; i < nnz; i++) { + solver_matrix.value(i) = 0.0; + } + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + else { + /* Multi-threaded execution: For Loops */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int additional_radial_tasks = grid_.ntheta() % 3; + const int num_radial_tasks = grid_.ntheta() - additional_radial_tasks; + + #pragma omp parallel + { + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 0) { + int i_theta = radial_task + additional_radial_tasks; + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + else { + if (additional_radial_tasks == 0) { + buildSolverMatrixRadialSection(0, solver_matrix); + } + else if (additional_radial_tasks >= 1) { + buildSolverMatrixRadialSection(0, solver_matrix); + buildSolverMatrixRadialSection(1, solver_matrix); + } + } + } + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 1) { + int i_theta = radial_task + additional_radial_tasks; + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + else { + if (additional_radial_tasks == 0) { + buildSolverMatrixRadialSection(1, solver_matrix); + } + else if (additional_radial_tasks == 1) { + buildSolverMatrixRadialSection(2, solver_matrix); + } + else if (additional_radial_tasks == 2) { + buildSolverMatrixRadialSection(2, solver_matrix); + buildSolverMatrixRadialSection(3, solver_matrix); + } + } + } + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 3) { + int i_theta = radial_task + additional_radial_tasks; + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + } + + /* Mumps: In the case of symmetric matrices, only half of the matrix should be provided. */ + /* Speeds up factorization time. */ + const bool construct_symmetric = true; + + if (!construct_symmetric) { + return solver_matrix; + } + + /* Only store the upper tridiagonal entries of the symmetric solver_matrix */ + const int symmetric_nnz = nnz - (nnz - n) / 2; + SparseMatrixCOO symmetric_solver_matrix(n, n, symmetric_nnz); + symmetric_solver_matrix.is_symmetric(true); + + int current_nz = 0; + for (int nz_index = 0; nz_index < nnz; nz_index++) { + const int row = solver_matrix.row_index(nz_index); + const int col = solver_matrix.col_index(nz_index); + if (row <= col) { + symmetric_solver_matrix.row_index(current_nz) = row; + symmetric_solver_matrix.col_index(current_nz) = col; + symmetric_solver_matrix.value(current_nz) = std::move(solver_matrix.value(nz_index)); + current_nz++; + } + } + + return symmetric_solver_matrix; +} +// clang-format on + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGive/directSolverGive.cpp b/src/DirectSolver/DirectSolverGive/directSolverGive.cpp new file mode 100644 index 00000000..1bfe881f --- /dev/null +++ b/src/DirectSolver/DirectSolverGive/directSolverGive.cpp @@ -0,0 +1,32 @@ +#include "../../../include/DirectSolver/DirectSolverGive/directSolverGive.h" + +#ifdef GMGPOLAR_USE_MUMPS + +DirectSolverGive::DirectSolverGive(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : DirectSolver(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ + solver_matrix_ = buildSolverMatrix(); + initializeMumpsSolver(mumps_solver_, solver_matrix_); +} + +void DirectSolverGive::solveInPlace(Vector& solution) +{ + // Adjusts the right-hand side vector to account for symmetry corrections. + // This transforms the system matrixA * solution = rhs into the equivalent system: + // symmetric_DBc(matrixA) * solution = rhs - applySymmetryShift(rhs). + // The correction modifies the rhs to account for the influence of the Dirichlet boundary conditions, + // ensuring that the solution at the boundary is correctly adjusted and maintains the required symmetry. + applySymmetryShift(solution); + // Solves the adjusted system symmetric(matrixA) * solution = rhs using the MUMPS solver. + solveWithMumps(solution); +} + +DirectSolverGive::~DirectSolverGive() +{ + finalizeMumpsSolver(mumps_solver_); +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGive/initializeMumps.cpp b/src/DirectSolver/DirectSolverGive/initializeMumps.cpp new file mode 100644 index 00000000..f9cceecb --- /dev/null +++ b/src/DirectSolver/DirectSolverGive/initializeMumps.cpp @@ -0,0 +1,124 @@ +#include "../../../include/DirectSolver/DirectSolverGive/directSolverGive.h" + +#ifdef GMGPOLAR_USE_MUMPS + +void DirectSolverGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix) +{ + /* + * MUMPS (a parallel direct solver) uses 1-based indexing, + * whereas the input matrix follows 0-based indexing. + * Adjust row and column indices to match MUMPS' requirements. + */ + for (int i = 0; i < solver_matrix.non_zero_size(); i++) { + solver_matrix.row_index(i) += 1; + solver_matrix.col_index(i) += 1; + } + + mumps_solver.job = JOB_INIT; + mumps_solver.par = PAR_PARALLEL; + /* The matrix is positive definite for invertible mappings. */ + /* Therefore we use SYM_POSITIVE_DEFINITE instead of SYM_GENERAL_SYMMETRIC. */ + mumps_solver.sym = (solver_matrix.is_symmetric() ? SYM_POSITIVE_DEFINITE : SYM_UNSYMMETRIC); + mumps_solver.comm_fortran = USE_COMM_WORLD; + dmumps_c(&mumps_solver); + + mumps_solver.ICNTL(1) = 0; // Output stream for error messages. + mumps_solver.ICNTL(2) = 0; // Output stream for diagnostic printing and statistics local to each MPI process. + mumps_solver.ICNTL(3) = 0; // Output stream for global information, collected on the host + mumps_solver.ICNTL(4) = 0; // Level of printing for error, warning, and diagnostic messages. + mumps_solver.ICNTL(5) = 0; // Controls the matrix input format + mumps_solver.ICNTL(6) = 7; // Permutes the matrix to a zero-free diagonal and/or scale the matrix + mumps_solver.ICNTL(7) = + 5; // Computes a symmetric permutation (ordering) to determine the pivot order to be used for the factorization in case of sequential analysis + mumps_solver.ICNTL(8) = 77; // Describes the scaling strategy + mumps_solver.ICNTL(9) = 1; // Computes the solution using A or A^T + mumps_solver.ICNTL(10) = 0; // Applies the iterative refinement to the computed solution + mumps_solver.ICNTL(11) = 0; // Computes statistics related to an error analysis of the linear system solved + mumps_solver.ICNTL(12) = 0; // Defines an ordering strategy for symmetric matrices and is used + mumps_solver.ICNTL(13) = 0; // Controls the parallelism of the root node + mumps_solver.ICNTL(14) = // Controls the percentage increase in the estimated working space + (solver_matrix.is_symmetric() ? 5 : 20); + mumps_solver.ICNTL(15) = 0; // Exploits compression of the input matrix resulting from a block format + mumps_solver.ICNTL(16) = 0; // Controls the setting of the number of OpenMP threads + // ICNTL(17) Doesn't exist + mumps_solver.ICNTL(18) = 0; // Defines the strategy for the distributed input matrix + mumps_solver.ICNTL(19) = 0; // Computes the Schur complement matrix + mumps_solver.ICNTL(20) = 0; // Determines the format (dense, sparse, or distributed) of the right-hand sides + mumps_solver.ICNTL(21) = 0; // Determines the distribution (centralized or distributed) of the solution vectors. + mumps_solver.ICNTL(22) = 0; // Controls the in-core/out-of-core (OOC) factorization and solve. + mumps_solver.ICNTL(23) = 0; // Corresponds to the maximum size of the working memory in MegaBytes that MUMPS can + // allocate per working process + mumps_solver.ICNTL(24) = 0; // Controls the detection of “null pivot rows”. + mumps_solver.ICNTL(25) = + 0; // Allows the computation of a solution of a deficient matrix and also of a null space basis + mumps_solver.ICNTL(26) = 0; // Drives the solution phase if a Schur complement matrix has been computed + mumps_solver.ICNTL(27) = -32; // Controls the blocking size for multiple right-hand sides. + mumps_solver.ICNTL(28) = 0; // Determines whether a sequential or parallel computation of the ordering is performed + mumps_solver.ICNTL(29) = + 0; // Defines the parallel ordering tool (when ICNTL(28)=1) to be used to compute the fill-in reducing permutation. + mumps_solver.ICNTL(30) = 0; // Computes a user-specified set of entries in the inverse A^−1 of the original matrix + mumps_solver.ICNTL(31) = 0; // Indicates which factors may be discarded during the factorization. + mumps_solver.ICNTL(32) = 0; // Performs the forward elimination of the right-hand sides during the factorization + mumps_solver.ICNTL(33) = 0; // Computes the determinant of the input matrix. + mumps_solver.ICNTL(34) = 0; // Controls the conservation of the OOC files during JOB= –3 + mumps_solver.ICNTL(35) = 0; // Controls the activation of the BLR feature + mumps_solver.ICNTL(36) = 0; // Controls the choice of BLR factorization variant + mumps_solver.ICNTL(37) = 0; // Controls the BLR compression of the contribution blocks + mumps_solver.ICNTL(38) = 600; // Estimates compression rate of LU factors + mumps_solver.ICNTL(39) = 500; // Estimates compression rate of contribution blocks + // ICNTL(40-47) Don't exist + mumps_solver.ICNTL(48) = 1; // Multithreading with tree parallelism + mumps_solver.ICNTL(49) = 0; // Compact workarray id%S at the end of factorization phase + // ICNTL(50-55) Don't exist + mumps_solver.ICNTL(56) = + 0; // Detects pseudo-singularities during factorization and factorizes the root node with a rankrevealing method + // ICNTL(57) Doesn't exist + mumps_solver.ICNTL(58) = 2; // Defines options for symbolic factorization + // ICNTL(59-60) Don't exist + + mumps_solver.CNTL(1) = -1.0; // Relative threshold for numerical pivoting + mumps_solver.CNTL(2) = -1.0; // Stopping criterion for iterative refinement + mumps_solver.CNTL(3) = 0.0; // Determine null pivot rows + mumps_solver.CNTL(4) = -1.0; // Determines the threshold for static pivoting + mumps_solver.CNTL(5) = + 0.0; // Defines the fixation for null pivots and is effective only when null pivot row detection is active + // CNTL(6) Doesn't exist + mumps_solver.CNTL(7) = 0.0; // Defines the precision of the dropping parameter used during BLR compression + // CNTL(8-15) Don't exist + + mumps_solver.job = JOB_ANALYSIS_AND_FACTORIZATION; + assert(solver_matrix.rows() == solver_matrix.columns()); + mumps_solver.n = solver_matrix.rows(); + mumps_solver.nz = solver_matrix.non_zero_size(); + mumps_solver.irn = solver_matrix.row_indices_data(); + mumps_solver.jcn = solver_matrix.column_indices_data(); + mumps_solver.a = solver_matrix.values_data(); + dmumps_c(&mumps_solver); + + if (mumps_solver.sym == SYM_POSITIVE_DEFINITE && mumps_solver.INFOG(12) != 0) { + std::cout + << "Warning: DirectSolver matrix is not positive definite: Negative pivots in the factorization phase." + << std::endl; + } +} + +void DirectSolverGive::solveWithMumps(Vector& result_rhs) +{ + mumps_solver_.job = JOB_COMPUTE_SOLUTION; + mumps_solver_.nrhs = 1; + mumps_solver_.nz_rhs = result_rhs.size(); + mumps_solver_.rhs = result_rhs.begin(); + mumps_solver_.lrhs = result_rhs.size(); + dmumps_c(&mumps_solver_); + if (mumps_solver_.info[0] != 0) { + std::cerr << "Error solving the direct system: " << mumps_solver_.info[0] << std::endl; + } +} + +void DirectSolverGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +{ + mumps_solver.job = JOB_END; + dmumps_c(&mumps_solver); +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGive/matrixStencil.cpp b/src/DirectSolver/DirectSolverGive/matrixStencil.cpp new file mode 100644 index 00000000..bd9abe1f --- /dev/null +++ b/src/DirectSolver/DirectSolverGive/matrixStencil.cpp @@ -0,0 +1,124 @@ +#include "../../../include/DirectSolver/DirectSolverGive/directSolverGive.h" + +#ifdef GMGPOLAR_USE_MUMPS + +const Stencil& DirectSolverGive::getStencil(int i_r) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + assert(grid_.nr() >= 4); + + if ((i_r > 1 && i_r < grid_.nr() - 2) || (i_r == 1 && !DirBC_Interior_)) { + return stencil_interior_; + } + else if (i_r == 0 && !DirBC_Interior_) { + return stencil_across_origin_; + } + else if ((i_r == 0 && DirBC_Interior_) || i_r == grid_.nr() - 1) { + return stencil_DB_; + } + else if (i_r == 1 && DirBC_Interior_) { + return stencil_next_inner_DB_; + } + else if (i_r == grid_.nr() - 2) { + return stencil_next_outer_DB_; + } + throw std::out_of_range("Invalid index for stencil"); +} + +int DirectSolverGive::getNonZeroCountSolverMatrix() const +{ + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 6 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 6; + const int size_stencil_outer_boundary = 1; + + assert(grid_.nr() >= 4); + + return grid_.ntheta() * + (size_stencil_inner_boundary + size_stencil_next_inner_boundary + (grid_.nr() - 4) * size_stencil_interior + + size_stencil_next_outer_boundary + size_stencil_outer_boundary); +} + +/* ----------------------------------------------------------------- */ +/* If the indexing is not smoother-based, please adjust the indexing */ +int DirectSolverGive::getSolverMatrixIndex(const int i_r, const int i_theta) const +{ + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 6 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 6; + const int size_stencil_outer_boundary = 1; + + assert(grid_.nr() >= 4); + assert(grid_.numberSmootherCircles() >= 2); + assert(grid_.lengthSmootherRadial() >= 2); + + if (1 < i_r && i_r < grid_.numberSmootherCircles()) { + // Interior: Circle index section + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = (i_r - 2) * grid_.ntheta() + i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes; + } + if (i_r >= grid_.numberSmootherCircles() && i_r < grid_.nr() - 2) { + // Interior: Radial index section + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = grid_.ntheta() * (grid_.numberSmootherCircles() - 2) + + i_theta * (grid_.lengthSmootherRadial() - 2) + i_r - + grid_.numberSmootherCircles(); + const int prior_next_outer_boundary_nodes = i_theta; + const int prior_outer_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes + + size_stencil_next_outer_boundary * prior_next_outer_boundary_nodes + + size_stencil_outer_boundary * prior_outer_boundary_nodes; + } + else if (i_r == 0) { + // Inner boundary + const int prior_inner_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes; + } + else if (i_r == 1) { + // Next to inner boundary + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes; + } + else if (i_r == grid_.nr() - 2) { + // Next to outer boundary + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = + grid_.ntheta() * (grid_.numberSmootherCircles() - 2) + (i_theta + 1) * (grid_.lengthSmootherRadial() - 2); + const int prior_next_outer_boundary_nodes = i_theta; + const int prior_outer_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes + + size_stencil_next_outer_boundary * prior_next_outer_boundary_nodes + + size_stencil_outer_boundary * prior_outer_boundary_nodes; + } + else if (i_r == grid_.nr() - 1) { + // Outer boundary + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = + grid_.ntheta() * (grid_.numberSmootherCircles() - 2) + (i_theta + 1) * (grid_.lengthSmootherRadial() - 2); + const int prior_next_outer_boundary_nodes = i_theta + 1; + const int prior_outer_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes + + size_stencil_next_outer_boundary * prior_next_outer_boundary_nodes + + size_stencil_outer_boundary * prior_outer_boundary_nodes; + } + throw std::out_of_range("Invalid index for stencil"); +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGiveCustomLU/buildSolverMatrix.cpp b/src/DirectSolver/DirectSolverGiveCustomLU/buildSolverMatrix.cpp new file mode 100644 index 00000000..6125415d --- /dev/null +++ b/src/DirectSolver/DirectSolverGiveCustomLU/buildSolverMatrix.cpp @@ -0,0 +1,870 @@ +#include "../../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" + +#include "../../../include/common/geometry_helper.h" + +#define UPDATE_MATRIX_ELEMENT(matrix, offset, row, col, val) \ + do { \ + matrix.row_nz_index(row, offset) = col; \ + matrix.row_nz_entry(row, offset) += val; \ + } while (0) + +#define NODE_BUILD_SOLVER_MATRIX_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, \ + solver_matrix, arr, att, art, detDF, coeff_beta) \ + do { \ + int offset; \ + int row, col; \ + double val; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 1 && i_r < grid.nr() - 2) { \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta_M1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopLeft]; \ + col = left_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomLeft]; \ + col = left_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + /* -------------------------- */ \ + /* Node on the inner boundary */ \ + /* -------------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + grid.ntheta()/2). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + assert(grid_.ntheta() % 2 == 0); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + grid.ntheta() / 2); \ + \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta_M1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r, i_theta_AcrossOrigin); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + /* From view the view of the across origin node, */ \ + /* the directions are roatated by 180 degrees in the stencil! */ \ + row = left_index; \ + \ + const Stencil& LeftStencil = CenterStencil; \ + \ + offset = LeftStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right -> Left*/ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) -> Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Top Right -> Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Bottom Right -> Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* TopLeft REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* BottomLeft REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + } \ + } \ + /* ------------------------------- */ \ + /* Node next to the inner boundary */ \ + /* ------------------------------- */ \ + else if (i_r == 1) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + if (!DirBC_Interior) { /* Don't give to the inner Dirichlet boundary! */ \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + \ + const Stencil& RightStencil = getStencil(i_r + 1); \ + \ + offset = RightStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::Center]; \ + col = right_index; \ + val = +coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::TopLeft]; \ + col = top_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = RightStencil[StencilPosition::BottomLeft]; \ + col = bottom_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopLeft]; \ + col = left_index; \ + val = +0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomLeft]; \ + col = left_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + /* ------------------------------- */ \ + /* Node next to the outer boundary */ \ + /* ------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = 0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + /* Don't give to the outer dirichlet boundary! */ \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopRight]; \ + col = right_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::TopLeft]; \ + col = left_index; \ + val = 0.25 * art; /* Top Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomRight]; \ + col = right_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::BottomLeft]; \ + col = left_index; \ + val = -0.25 * art; /* Bottom Left */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + /* ------------------------------------ */ \ + /* Node on the outer dirichlet boundary */ \ + /* ------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* Give value to the interior nodes! */ \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Right]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::TopRight]; \ + col = top_index; \ + val = -0.25 * art; /* Top Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::BottomRight]; \ + col = bottom_index; \ + val = +0.25 * art; /* Bottom Right */ \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + } while (0) + +void DirectSolverGiveCustomLU::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCSR& solver_matrix) +{ + const double r = grid_.radius(i_r); + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int global_index = grid_.index(i_r, i_theta); + const double theta = grid_.theta(i_theta); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + solver_matrix, arr, att, art, detDF, coeff_beta); + } +} + +void DirectSolverGiveCustomLU::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCSR& solver_matrix) +{ + const double theta = grid_.theta(i_theta); + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int global_index = grid_.index(i_r, i_theta); + const double r = grid_.radius(i_r); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + solver_matrix, arr, att, art, detDF, coeff_beta); + } +} + +// clang-format off + +/* ------------------------------------------------------------------------ */ +/* If the indexing is not smoother-based, please adjust the access patterns */ +SparseMatrixCSR DirectSolverGiveCustomLU::buildSolverMatrix() +{ + omp_set_num_threads(num_omp_threads_); + + const int n = grid_.numberOfNodes(); + + std::function nnz_per_row = [&](int global_index) { + return getStencilSize(global_index); + }; + + SparseMatrixCSR solver_matrix(n, n, nnz_per_row); + + const int nnz = solver_matrix.non_zero_size(); + + #pragma omp parallel for if (nnz > 10'000) + for (int i = 0; i < nnz; i++) { + solver_matrix.values_data()[i] = 0.0; + } + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + else { + /* Multi-threaded execution: For Loops */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int additional_radial_tasks = grid_.ntheta() % 3; + const int num_radial_tasks = grid_.ntheta() - additional_radial_tasks; + + #pragma omp parallel + { + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 0) { + int i_theta = radial_task + additional_radial_tasks; + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + else { + if (additional_radial_tasks == 0) { + buildSolverMatrixRadialSection(0, solver_matrix); + } + else if (additional_radial_tasks >= 1) { + buildSolverMatrixRadialSection(0, solver_matrix); + buildSolverMatrixRadialSection(1, solver_matrix); + } + } + } + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 1) { + int i_theta = radial_task + additional_radial_tasks; + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + else { + if (additional_radial_tasks == 0) { + buildSolverMatrixRadialSection(1, solver_matrix); + } + else if (additional_radial_tasks == 1) { + buildSolverMatrixRadialSection(2, solver_matrix); + } + else if (additional_radial_tasks == 2) { + buildSolverMatrixRadialSection(2, solver_matrix); + buildSolverMatrixRadialSection(3, solver_matrix); + } + } + } + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 3) { + int i_theta = radial_task + additional_radial_tasks; + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + } + + return solver_matrix; +} +// clang-format on \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGiveCustomLU/directSolverGive.cpp b/src/DirectSolver/DirectSolverGiveCustomLU/directSolverGive.cpp new file mode 100644 index 00000000..46eb49dd --- /dev/null +++ b/src/DirectSolver/DirectSolverGiveCustomLU/directSolverGive.cpp @@ -0,0 +1,20 @@ +#include "../../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" + +DirectSolverGiveCustomLU::DirectSolverGiveCustomLU(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + bool DirBC_Interior, int num_omp_threads) + : DirectSolver(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ + solver_matrix_ = buildSolverMatrix(); + lu_solver_ = SparseLUSolver(solver_matrix_); +} + +void DirectSolverGiveCustomLU::solveInPlace(Vector& solution) +{ + lu_solver_.solveInPlace(solution); +} + +DirectSolverGiveCustomLU::~DirectSolverGiveCustomLU() +{ +} \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverGiveCustomLU/matrixStencil.cpp b/src/DirectSolver/DirectSolverGiveCustomLU/matrixStencil.cpp new file mode 100644 index 00000000..42b5312e --- /dev/null +++ b/src/DirectSolver/DirectSolverGiveCustomLU/matrixStencil.cpp @@ -0,0 +1,68 @@ +#include "../../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" + +int DirectSolverGiveCustomLU::getStencilSize(int global_index) const +{ + int i_r, i_theta; + grid_.multiIndex(global_index, i_r, i_theta); + + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 9 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 9; + const int size_stencil_outer_boundary = 1; + + if ((i_r > 1 && i_r < grid_.nr() - 2) || (i_r == 1 && !DirBC_Interior_)) { + return size_stencil_interior; + } + else if (i_r == 0 && !DirBC_Interior_) { + return size_stencil_inner_boundary; + } + else if ((i_r == 0 && DirBC_Interior_) || i_r == grid_.nr() - 1) { + return size_stencil_outer_boundary; + } + else if (i_r == 1 && DirBC_Interior_) { + return size_stencil_next_inner_boundary; + } + else if (i_r == grid_.nr() - 2) { + return size_stencil_next_outer_boundary; + } + throw std::out_of_range("Invalid index for stencil"); +} + +const Stencil& DirectSolverGiveCustomLU::getStencil(int i_r) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + assert(grid_.nr() >= 4); + + if ((i_r > 1 && i_r < grid_.nr() - 2) || (i_r == 1 && !DirBC_Interior_)) { + return stencil_interior_; + } + else if (i_r == 0 && !DirBC_Interior_) { + return stencil_across_origin_; + } + else if ((i_r == 0 && DirBC_Interior_) || i_r == grid_.nr() - 1) { + return stencil_DB_; + } + else if (i_r == 1 && DirBC_Interior_) { + return stencil_next_inner_DB_; + } + else if (i_r == grid_.nr() - 2) { + return stencil_next_outer_DB_; + } + throw std::out_of_range("Invalid index for stencil"); +} + +int DirectSolverGiveCustomLU::getNonZeroCountSolverMatrix() const +{ + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 9 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 9; + const int size_stencil_outer_boundary = 1; + + assert(grid_.nr() >= 4); + + return grid_.ntheta() * + (size_stencil_inner_boundary + size_stencil_next_inner_boundary + (grid_.nr() - 4) * size_stencil_interior + + size_stencil_next_outer_boundary + size_stencil_outer_boundary); +} diff --git a/src/DirectSolver/DirectSolverTake/applySymmetryShift.cpp b/src/DirectSolver/DirectSolverTake/applySymmetryShift.cpp new file mode 100644 index 00000000..6e0b819c --- /dev/null +++ b/src/DirectSolver/DirectSolverTake/applySymmetryShift.cpp @@ -0,0 +1,113 @@ +#include "../../../include/DirectSolver/DirectSolverTake/directSolverTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + +/* ----------------------- */ +/* Boundary Symmetry Shift */ +/* ----------------------- */ + +void DirectSolverTake::applySymmetryShiftInnerBoundary(Vector& x) const +{ + assert(DirBC_Interior_); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + + const int i_r = 1; + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + double h1 = grid_.radialSpacing(i_r - 1); + double k1 = grid_.angularSpacing(i_theta - 1); + double k2 = grid_.angularSpacing(i_theta); + + double coeff1 = 0.5 * (k1 + k2) / h1; + + const int i_theta_M1 = grid_.wrapThetaIndex(i_theta - 1); + const int i_theta_P1 = grid_.wrapThetaIndex(i_theta + 1); + + const int bottom_left = grid_.index(i_r - 1, i_theta_M1); + const int left = grid_.index(i_r - 1, i_theta); + const int top_left = grid_.index(i_r - 1, i_theta_P1); + const int bottom = grid_.index(i_r, i_theta_M1); + const int center = grid_.index(i_r, i_theta); + const int top = grid_.index(i_r, i_theta_P1); + + x[center] -= (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ + ); + } +} + +void DirectSolverTake::applySymmetryShiftOuterBoundary(Vector& x) const +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + + const int i_r = grid_.nr() - 2; + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + double h2 = grid_.radialSpacing(i_r); + double k1 = grid_.angularSpacing(i_theta - 1); + double k2 = grid_.angularSpacing(i_theta); + + double coeff2 = 0.5 * (k1 + k2) / h2; + + const int i_theta_M1 = grid_.wrapThetaIndex(i_theta - 1); + const int i_theta_P1 = grid_.wrapThetaIndex(i_theta + 1); + + const int bottom = grid_.index(i_r, i_theta_M1); + const int center = grid_.index(i_r, i_theta); + const int top = grid_.index(i_r, i_theta_P1); + const int bottom_right = grid_.index(i_r + 1, i_theta_M1); + const int right = grid_.index(i_r + 1, i_theta); + const int top_right = grid_.index(i_r + 1, i_theta_P1); + + x[center] -= (-coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ + ); + } +} + +void DirectSolverTake::applySymmetryShift(Vector& x) const +{ + assert(x.size() == grid_.numberOfNodes()); + assert(grid_.nr() >= 4); + + omp_set_num_threads(num_omp_threads_); + + if (num_omp_threads_ == 1) { + /* Single-threaded execution */ + if (DirBC_Interior_) { + applySymmetryShiftInnerBoundary(x); + } + applySymmetryShiftOuterBoundary(x); + } + else { + #pragma omp parallel sections + { + #pragma omp section + { + if (DirBC_Interior_) { + applySymmetryShiftInnerBoundary(x); + } + } + + #pragma omp section + { + applySymmetryShiftOuterBoundary(x); + } + } + } +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTake/buildSolverMatrix.cpp b/src/DirectSolver/DirectSolverTake/buildSolverMatrix.cpp new file mode 100644 index 00000000..b83ce9ea --- /dev/null +++ b/src/DirectSolver/DirectSolverTake/buildSolverMatrix.cpp @@ -0,0 +1,555 @@ +#include "../../../include/DirectSolver/DirectSolverTake/directSolverTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + + #define UPDATE_MATRIX_ELEMENT(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_index(ptr + offset) = row; \ + matrix.col_index(ptr + offset) = col; \ + matrix.value(ptr + offset) = val; \ + } while (0) + + #define NODE_BUILD_SOLVER_MATRIX_TAKE(i_r, i_theta, grid, DirBC_Interior, solver_matrix, arr, att, art, detDF, \ + coeff_beta) \ + do { \ + int ptr, offset; \ + int row, col; \ + double val; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 1 && i_r < grid.nr() - 2) { \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta_M1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + const int bottom_left_index = grid.index(i_r - 1, i_theta_M1); \ + const int bottom_right_index = grid.index(i_r + 1, i_theta_M1); \ + const int top_left_index = grid.index(i_r - 1, i_theta_P1); \ + const int top_right_index = grid.index(i_r + 1, i_theta_P1); \ + \ + const double left_value = -coeff1 * (arr[center_index] + arr[left_index]); /* Left */ \ + const double right_value = -coeff2 * (arr[center_index] + arr[right_index]); /* Right */ \ + const double bottom_value = -coeff3 * (att[center_index] + att[bottom_index]); /* Bottom */ \ + const double top_value = -coeff4 * (att[center_index] + att[top_index]); /* Top */ \ + \ + const double center_value = \ + (+0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center_index]) /* beta_{i,j} */ \ + - left_value /* Center: (Left) */ \ + - right_value /* Center: (Right) */ \ + - bottom_value /* Center: (Bottom) */ \ + - top_value /* Center: (Top) */ \ + ); \ + \ + const double bottom_left_value = -0.25 * (art[left_index] + art[bottom_index]); /* Bottom Left */ \ + const double bottom_right_value = +0.25 * (art[right_index] + art[bottom_index]); /* Bottom Right */ \ + const double top_left_value = +0.25 * (art[left_index] + art[top_index]); /* Top Left */ \ + const double top_right_value = -0.25 * (art[right_index] + art[top_index]); /* Top Right */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::BottomLeft]; \ + col = bottom_left_index; \ + val = bottom_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::BottomRight]; \ + col = bottom_right_index; \ + val = bottom_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::TopLeft]; \ + col = top_left_index; \ + val = top_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::TopRight]; \ + col = top_right_index; \ + val = top_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + /* -------------------------- */ \ + /* Node on the inner boundary */ \ + /* -------------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + grid.ntheta()/2). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + assert(grid_.ntheta() % 2 == 0); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + grid.ntheta() / 2); \ + \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta_M1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r, i_theta_AcrossOrigin); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + const int bottom_right_index = grid.index(i_r + 1, i_theta_M1); \ + const int top_right_index = grid.index(i_r + 1, i_theta_P1); \ + \ + const double left_value = -coeff1 * (arr[center_index] + arr[left_index]); /* Left */ \ + const double right_value = -coeff2 * (arr[center_index] + arr[right_index]); /* Right */ \ + const double bottom_value = -coeff3 * (att[center_index] + att[bottom_index]); /* Bottom */ \ + const double top_value = -coeff4 * (att[center_index] + att[top_index]); /* Top */ \ + \ + const double center_value = \ + (+0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center_index]) /* beta_{i,j} */ \ + - left_value /* Center: (Left) */ \ + - right_value /* Center: (Right) */ \ + - bottom_value /* Center: (Bottom) */ \ + - top_value /* Center: (Top) */ \ + ); \ + \ + const double bottom_right_value = \ + +0.25 * (art[right_index] + art[bottom_index]); /* Bottom Right */ \ + const double top_right_value = -0.25 * (art[right_index] + art[top_index]); /* Top Right */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* BottomLeft: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + offset = CenterStencil[StencilPosition::BottomRight]; \ + col = bottom_right_index; \ + val = bottom_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* TopLeft: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + offset = CenterStencil[StencilPosition::TopRight]; \ + col = top_right_index; \ + val = top_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + } \ + /* ------------------------------- */ \ + /* Node next to the inner boundary */ \ + /* ------------------------------- */ \ + else if (i_r == 1) { \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta_M1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + const int bottom_left_index = grid.index(i_r - 1, i_theta_M1); \ + const int bottom_right_index = grid.index(i_r + 1, i_theta_M1); \ + const int top_left_index = grid.index(i_r - 1, i_theta_P1); \ + const int top_right_index = grid.index(i_r + 1, i_theta_P1); \ + \ + const double left_value = -coeff1 * (arr[center_index] + arr[left_index]); /* Left */ \ + const double right_value = -coeff2 * (arr[center_index] + arr[right_index]); /* Right */ \ + const double bottom_value = -coeff3 * (att[center_index] + att[bottom_index]); /* Bottom */ \ + const double top_value = -coeff4 * (att[center_index] + att[top_index]); /* Top */ \ + \ + const double center_value = \ + (+0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center_index]) /* beta_{i,j} */ \ + - left_value /* Center: (Left) */ \ + - right_value /* Center: (Right) */ \ + - bottom_value /* Center: (Bottom) */ \ + - top_value /* Center: (Top) */ \ + ); \ + \ + const double bottom_left_value = -0.25 * (art[left_index] + art[bottom_index]); /* Bottom Left */ \ + const double bottom_right_value = +0.25 * (art[right_index] + art[bottom_index]); /* Bottom Right */ \ + const double top_left_value = +0.25 * (art[left_index] + art[top_index]); /* Top Left */ \ + const double top_right_value = -0.25 * (art[right_index] + art[top_index]); /* Top Right */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + if (!DirBC_Interior) { \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + if (!DirBC_Interior) { \ + offset = CenterStencil[StencilPosition::BottomLeft]; \ + col = bottom_left_index; \ + val = bottom_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + \ + offset = CenterStencil[StencilPosition::BottomRight]; \ + col = bottom_right_index; \ + val = bottom_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + if (!DirBC_Interior) { \ + offset = CenterStencil[StencilPosition::TopLeft]; \ + col = top_left_index; \ + val = top_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + \ + offset = CenterStencil[StencilPosition::TopRight]; \ + col = top_right_index; \ + val = top_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + /* ------------------------------- */ \ + /* Node next to the outer boundary */ \ + /* ------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta_M1); \ + const double k2 = grid.angularSpacing(i_theta); \ + \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + const int bottom_left_index = grid.index(i_r - 1, i_theta_M1); \ + const int bottom_right_index = grid.index(i_r + 1, i_theta_M1); \ + const int top_left_index = grid.index(i_r - 1, i_theta_P1); \ + const int top_right_index = grid.index(i_r + 1, i_theta_P1); \ + \ + const double left_value = -coeff1 * (arr[center_index] + arr[left_index]); /* Left */ \ + const double right_value = -coeff2 * (arr[center_index] + arr[right_index]); /* Right */ \ + const double bottom_value = -coeff3 * (att[center_index] + att[bottom_index]); /* Bottom */ \ + const double top_value = -coeff4 * (att[center_index] + att[top_index]); /* Top */ \ + \ + const double center_value = \ + (+0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center_index]) /* beta_{i,j} */ \ + - left_value /* Center: (Left) */ \ + - right_value /* Center: (Right) */ \ + - bottom_value /* Center: (Bottom) */ \ + - top_value /* Center: (Top) */ \ + ); \ + \ + const double bottom_left_value = -0.25 * (art[left_index] + art[bottom_index]); /* Bottom Left */ \ + const double bottom_right_value = +0.25 * (art[right_index] + art[bottom_index]); /* Bottom Right */ \ + const double top_left_value = +0.25 * (art[left_index] + art[top_index]); /* Top Left */ \ + const double top_right_value = -0.25 * (art[right_index] + art[top_index]); /* Top Right */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* Right REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::BottomLeft]; \ + col = bottom_left_index; \ + val = bottom_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* BottomRight REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + \ + offset = CenterStencil[StencilPosition::TopLeft]; \ + col = top_left_index; \ + val = top_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + \ + /* TopRight REMOVED: Moved to the right hand side to make the matrix symmetric */ \ + } \ + /* ------------------------------------ */ \ + /* Node on the outer dirichlet boundary */ \ + /* ------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + const int center_nz_index = getSolverMatrixIndex(i_r, i_theta); \ + \ + const int center_index = grid.index(i_r, i_theta); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, ptr, offset, row, col, val); \ + } \ + } while (0) + +void DirectSolverTake::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCOO& solver_matrix) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_TAKE(i_r, i_theta, grid_, DirBC_Interior_, solver_matrix, arr, att, art, detDF, + coeff_beta); + } +} + +void DirectSolverTake::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCOO& solver_matrix) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_TAKE(i_r, i_theta, grid_, DirBC_Interior_, solver_matrix, arr, att, art, detDF, + coeff_beta); + } +} + +// clang-format off + +/* ------------------------------------------------------------------------ */ +/* If the indexing is not smoother-based, please adjust the access patterns */ +SparseMatrixCOO DirectSolverTake::buildSolverMatrix() +{ + omp_set_num_threads(num_omp_threads_); + + const int n = grid_.numberOfNodes(); + const int nnz = getNonZeroCountSolverMatrix(); + + // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. + SparseMatrixCOO solver_matrix(n, n, nnz); + solver_matrix.is_symmetric(false); + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + else { + /* Multi-threaded execution */ + #pragma omp parallel + { + /* Circle Section */ + #pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + /* Radial Section */ + #pragma omp for nowait + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + } + + /* Mumps: In the case of symmetric matrices, only half of the matrix should be provided. */ + const bool construct_symmetric = true; + + if (!construct_symmetric) { + return solver_matrix; + } + + /* Only store the upper tridiagonal entries of the symmetric solver_matrix */ + const int symmetric_nnz = nnz - (nnz - n) / 2; + SparseMatrixCOO symmetric_solver_matrix(n, n, symmetric_nnz); + symmetric_solver_matrix.is_symmetric(true); + + int current_nz = 0; + for (int nz_index = 0; nz_index < nnz; nz_index++) { + const int row = solver_matrix.row_index(nz_index); + const int col = solver_matrix.col_index(nz_index); + if (row <= col) { + symmetric_solver_matrix.row_index(current_nz) = row; + symmetric_solver_matrix.col_index(current_nz) = col; + symmetric_solver_matrix.value(current_nz) = std::move(solver_matrix.value(nz_index)); + current_nz++; + } + } + + return symmetric_solver_matrix; +} +// clang-format on + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTake/directSolverTake.cpp b/src/DirectSolver/DirectSolverTake/directSolverTake.cpp new file mode 100644 index 00000000..2ade8fe9 --- /dev/null +++ b/src/DirectSolver/DirectSolverTake/directSolverTake.cpp @@ -0,0 +1,32 @@ +#include "../../../include/DirectSolver/DirectSolverTake/directSolverTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + +DirectSolverTake::DirectSolverTake(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : DirectSolver(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ + solver_matrix_ = buildSolverMatrix(); + initializeMumpsSolver(mumps_solver_, solver_matrix_); +} + +void DirectSolverTake::solveInPlace(Vector& solution) +{ + // Adjusts the right-hand side vector to account for symmetry corrections. + // This transforms the system matrixA * solution = rhs into the equivalent system: + // symmetric_DBc(matrixA) * solution = rhs - applySymmetryShift(rhs). + // The correction modifies the rhs to account for the influence of the Dirichlet boundary conditions, + // ensuring that the solution at the boundary is correctly adjusted and maintains the required symmetry. + applySymmetryShift(solution); + // Solves the adjusted system symmetric(matrixA) * solution = rhs using the MUMPS solver. + solveWithMumps(solution); +} + +DirectSolverTake::~DirectSolverTake() +{ + finalizeMumpsSolver(mumps_solver_); +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTake/initializeMumps.cpp b/src/DirectSolver/DirectSolverTake/initializeMumps.cpp new file mode 100644 index 00000000..58b9c1f2 --- /dev/null +++ b/src/DirectSolver/DirectSolverTake/initializeMumps.cpp @@ -0,0 +1,124 @@ +#include "../../../include/DirectSolver/DirectSolverTake/directSolverTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + +void DirectSolverTake::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix) +{ + /* + * MUMPS (a parallel direct solver) uses 1-based indexing, + * whereas the input matrix follows 0-based indexing. + * Adjust row and column indices to match MUMPS' requirements. + */ + for (int i = 0; i < solver_matrix.non_zero_size(); i++) { + solver_matrix.row_index(i) += 1; + solver_matrix.col_index(i) += 1; + } + + mumps_solver.job = JOB_INIT; + mumps_solver.par = PAR_PARALLEL; + /* The matrix is positive definite for invertible mappings. */ + /* Therefore we use SYM_POSITIVE_DEFINITE instead of SYM_GENERAL_SYMMETRIC. */ + mumps_solver.sym = (solver_matrix.is_symmetric() ? SYM_POSITIVE_DEFINITE : SYM_UNSYMMETRIC); + mumps_solver.comm_fortran = USE_COMM_WORLD; + dmumps_c(&mumps_solver); + + mumps_solver.ICNTL(1) = 0; // Output stream for error messages. + mumps_solver.ICNTL(2) = 0; // Output stream for diagnostic printing and statistics local to each MPI process. + mumps_solver.ICNTL(3) = 0; // Output stream for global information, collected on the host + mumps_solver.ICNTL(4) = 0; // Level of printing for error, warning, and diagnostic messages. + mumps_solver.ICNTL(5) = 0; // Controls the matrix input format + mumps_solver.ICNTL(6) = 7; // Permutes the matrix to a zero-free diagonal and/or scale the matrix + mumps_solver.ICNTL(7) = + 5; // Computes a symmetric permutation (ordering) to determine the pivot order to be used for the factorization in case of sequential analysis + mumps_solver.ICNTL(8) = 77; // Describes the scaling strategy + mumps_solver.ICNTL(9) = 1; // Computes the solution using A or A^T + mumps_solver.ICNTL(10) = 0; // Applies the iterative refinement to the computed solution + mumps_solver.ICNTL(11) = 0; // Computes statistics related to an error analysis of the linear system solved + mumps_solver.ICNTL(12) = 0; // Defines an ordering strategy for symmetric matrices and is used + mumps_solver.ICNTL(13) = 0; // Controls the parallelism of the root node + mumps_solver.ICNTL(14) = // Controls the percentage increase in the estimated working space + (solver_matrix.is_symmetric() ? 5 : 20); + mumps_solver.ICNTL(15) = 0; // Exploits compression of the input matrix resulting from a block format + mumps_solver.ICNTL(16) = 0; // Controls the setting of the number of OpenMP threads + // ICNTL(17) Doesn't exist + mumps_solver.ICNTL(18) = 0; // Defines the strategy for the distributed input matrix + mumps_solver.ICNTL(19) = 0; // Computes the Schur complement matrix + mumps_solver.ICNTL(20) = 0; // Determines the format (dense, sparse, or distributed) of the right-hand sides + mumps_solver.ICNTL(21) = 0; // Determines the distribution (centralized or distributed) of the solution vectors. + mumps_solver.ICNTL(22) = 0; // Controls the in-core/out-of-core (OOC) factorization and solve. + mumps_solver.ICNTL(23) = 0; // Corresponds to the maximum size of the working memory in MegaBytes that MUMPS can + // allocate per working process + mumps_solver.ICNTL(24) = 0; // Controls the detection of “null pivot rows”. + mumps_solver.ICNTL(25) = + 0; // Allows the computation of a solution of a deficient matrix and also of a null space basis + mumps_solver.ICNTL(26) = 0; // Drives the solution phase if a Schur complement matrix has been computed + mumps_solver.ICNTL(27) = -32; // Controls the blocking size for multiple right-hand sides. + mumps_solver.ICNTL(28) = 0; // Determines whether a sequential or parallel computation of the ordering is performed + mumps_solver.ICNTL(29) = + 0; // Defines the parallel ordering tool (when ICNTL(28)=1) to be used to compute the fill-in reducing permutation. + mumps_solver.ICNTL(30) = 0; // Computes a user-specified set of entries in the inverse A^−1 of the original matrix + mumps_solver.ICNTL(31) = 0; // Indicates which factors may be discarded during the factorization. + mumps_solver.ICNTL(32) = 0; // Performs the forward elimination of the right-hand sides during the factorization + mumps_solver.ICNTL(33) = 0; // Computes the determinant of the input matrix. + mumps_solver.ICNTL(34) = 0; // Controls the conservation of the OOC files during JOB= –3 + mumps_solver.ICNTL(35) = 0; // Controls the activation of the BLR feature + mumps_solver.ICNTL(36) = 0; // Controls the choice of BLR factorization variant + mumps_solver.ICNTL(37) = 0; // Controls the BLR compression of the contribution blocks + mumps_solver.ICNTL(38) = 600; // Estimates compression rate of LU factors + mumps_solver.ICNTL(39) = 500; // Estimates compression rate of contribution blocks + // ICNTL(40-47) Don't exist + mumps_solver.ICNTL(48) = 1; // Multithreading with tree parallelism + mumps_solver.ICNTL(49) = 0; // Compact workarray id%S at the end of factorization phase + // ICNTL(50-55) Don't exist + mumps_solver.ICNTL(56) = + 0; // Detects pseudo-singularities during factorization and factorizes the root node with a rankrevealing method + // ICNTL(57) Doesn't exist + mumps_solver.ICNTL(58) = 2; // Defines options for symbolic factorization + // ICNTL(59-60) Don't exist + + mumps_solver.CNTL(1) = -1.0; // Relative threshold for numerical pivoting + mumps_solver.CNTL(2) = -1.0; // Stopping criterion for iterative refinement + mumps_solver.CNTL(3) = 0.0; // Determine null pivot rows + mumps_solver.CNTL(4) = -1.0; // Determines the threshold for static pivoting + mumps_solver.CNTL(5) = + 0.0; // Defines the fixation for null pivots and is effective only when null pivot row detection is active + // CNTL(6) Doesn't exist + mumps_solver.CNTL(7) = 0.0; // Defines the precision of the dropping parameter used during BLR compression + // CNTL(8-15) Don't exist + + mumps_solver.job = JOB_ANALYSIS_AND_FACTORIZATION; + assert(solver_matrix.rows() == solver_matrix.columns()); + mumps_solver.n = solver_matrix.rows(); + mumps_solver.nz = solver_matrix.non_zero_size(); + mumps_solver.irn = solver_matrix.row_indices_data(); + mumps_solver.jcn = solver_matrix.column_indices_data(); + mumps_solver.a = solver_matrix.values_data(); + dmumps_c(&mumps_solver); + + if (mumps_solver.sym == SYM_POSITIVE_DEFINITE && mumps_solver.INFOG(12) != 0) { + std::cout + << "Warning: DirectSolver matrix is not positive definite: Negative pivots in the factorization phase." + << std::endl; + } +} + +void DirectSolverTake::solveWithMumps(Vector& result_rhs) +{ + mumps_solver_.job = JOB_COMPUTE_SOLUTION; + mumps_solver_.nrhs = 1; + mumps_solver_.nz_rhs = result_rhs.size(); + mumps_solver_.rhs = result_rhs.begin(); + mumps_solver_.lrhs = result_rhs.size(); + dmumps_c(&mumps_solver_); + if (mumps_solver_.info[0] != 0) { + std::cerr << "Error solving the direct system: " << mumps_solver_.info[0] << std::endl; + } +} + +void DirectSolverTake::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +{ + mumps_solver.job = JOB_END; + dmumps_c(&mumps_solver); +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTake/matrixStencil.cpp b/src/DirectSolver/DirectSolverTake/matrixStencil.cpp new file mode 100644 index 00000000..fa37d220 --- /dev/null +++ b/src/DirectSolver/DirectSolverTake/matrixStencil.cpp @@ -0,0 +1,124 @@ +#include "../../../include/DirectSolver/DirectSolverTake/directSolverTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + +const Stencil& DirectSolverTake::getStencil(int i_r) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + assert(grid_.nr() >= 4); + + if ((i_r > 1 && i_r < grid_.nr() - 2) || (i_r == 1 && !DirBC_Interior_)) { + return stencil_interior_; + } + else if (i_r == 0 && !DirBC_Interior_) { + return stencil_across_origin_; + } + else if ((i_r == 0 && DirBC_Interior_) || i_r == grid_.nr() - 1) { + return stencil_DB_; + } + else if (i_r == 1 && DirBC_Interior_) { + return stencil_next_inner_DB_; + } + else if (i_r == grid_.nr() - 2) { + return stencil_next_outer_DB_; + } + throw std::out_of_range("Invalid index for stencil"); +} + +int DirectSolverTake::getNonZeroCountSolverMatrix() const +{ + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 6 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 6; + const int size_stencil_outer_boundary = 1; + + assert(grid_.nr() >= 4); + + return grid_.ntheta() * + (size_stencil_inner_boundary + size_stencil_next_inner_boundary + (grid_.nr() - 4) * size_stencil_interior + + size_stencil_next_outer_boundary + size_stencil_outer_boundary); +} + +/* ----------------------------------------------------------------- */ +/* If the indexing is not smoother-based, please adjust the indexing */ +int DirectSolverTake::getSolverMatrixIndex(const int i_r, const int i_theta) const +{ + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 6 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 6; + const int size_stencil_outer_boundary = 1; + + assert(grid_.nr() >= 4); + assert(grid_.numberSmootherCircles() >= 2); + assert(grid_.lengthSmootherRadial() >= 2); + + if (1 < i_r && i_r < grid_.numberSmootherCircles()) { + // Interior: Circle index section + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = (i_r - 2) * grid_.ntheta() + i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes; + } + if (i_r >= grid_.numberSmootherCircles() && i_r < grid_.nr() - 2) { + // Interior: Radial index section + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = grid_.ntheta() * (grid_.numberSmootherCircles() - 2) + + i_theta * (grid_.lengthSmootherRadial() - 2) + i_r - + grid_.numberSmootherCircles(); + const int prior_next_outer_boundary_nodes = i_theta; + const int prior_outer_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes + + size_stencil_next_outer_boundary * prior_next_outer_boundary_nodes + + size_stencil_outer_boundary * prior_outer_boundary_nodes; + } + else if (i_r == 0) { + // Inner boundary + const int prior_inner_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes; + } + else if (i_r == 1) { + // Next to inner boundary + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes; + } + else if (i_r == grid_.nr() - 2) { + // Next to outer boundary + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = + grid_.ntheta() * (grid_.numberSmootherCircles() - 2) + (i_theta + 1) * (grid_.lengthSmootherRadial() - 2); + const int prior_next_outer_boundary_nodes = i_theta; + const int prior_outer_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes + + size_stencil_next_outer_boundary * prior_next_outer_boundary_nodes + + size_stencil_outer_boundary * prior_outer_boundary_nodes; + } + else if (i_r == grid_.nr() - 1) { + // Outer boundary + const int prior_inner_boundary_nodes = grid_.ntheta(); + const int prior_next_inner_boundary_nodes = grid_.ntheta(); + const int prior_interior_nodes = + grid_.ntheta() * (grid_.numberSmootherCircles() - 2) + (i_theta + 1) * (grid_.lengthSmootherRadial() - 2); + const int prior_next_outer_boundary_nodes = i_theta + 1; + const int prior_outer_boundary_nodes = i_theta; + return size_stencil_inner_boundary * prior_inner_boundary_nodes + + size_stencil_next_inner_boundary * prior_next_inner_boundary_nodes + + size_stencil_interior * prior_interior_nodes + + size_stencil_next_outer_boundary * prior_next_outer_boundary_nodes + + size_stencil_outer_boundary * prior_outer_boundary_nodes; + } + throw std::out_of_range("Invalid index for stencil"); +} + +#endif \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTakeCustomLU/buildSolverMatrix.cpp b/src/DirectSolver/DirectSolverTakeCustomLU/buildSolverMatrix.cpp new file mode 100644 index 00000000..18e8d8f7 --- /dev/null +++ b/src/DirectSolver/DirectSolverTakeCustomLU/buildSolverMatrix.cpp @@ -0,0 +1,319 @@ +#include "../../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" + +#define UPDATE_MATRIX_ELEMENT(matrix, offset, row, col, val) \ + do { \ + matrix.row_nz_index(row, offset) = col; \ + matrix.row_nz_entry(row, offset) = val; \ + } while (0) + +#define NODE_BUILD_SOLVER_MATRIX_TAKE(i_r, i_theta, grid, DirBC_Interior, solver_matrix, arr, att, art, detDF, \ + coeff_beta) \ + do { \ + int offset; \ + int row, col; \ + double val; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 0 && i_r < grid.nr() - 1) { \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta_M1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r - 1, i_theta); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + const int bottom_left_index = grid.index(i_r - 1, i_theta_M1); \ + const int bottom_right_index = grid.index(i_r + 1, i_theta_M1); \ + const int top_left_index = grid.index(i_r - 1, i_theta_P1); \ + const int top_right_index = grid.index(i_r + 1, i_theta_P1); \ + \ + const double left_value = -coeff1 * (arr[center_index] + arr[left_index]); /* Left */ \ + const double right_value = -coeff2 * (arr[center_index] + arr[right_index]); /* Right */ \ + const double bottom_value = -coeff3 * (att[center_index] + att[bottom_index]); /* Bottom */ \ + const double top_value = -coeff4 * (att[center_index] + att[top_index]); /* Top */ \ + \ + const double center_value = \ + (+0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center_index]) /* beta_{i,j} */ \ + - left_value /* Center: (Left) */ \ + - right_value /* Center: (Right) */ \ + - bottom_value /* Center: (Bottom) */ \ + - top_value /* Center: (Top) */ \ + ); \ + \ + const double bottom_left_value = -0.25 * (art[left_index] + art[bottom_index]); /* Bottom Left */ \ + const double bottom_right_value = +0.25 * (art[right_index] + art[bottom_index]); /* Bottom Right */ \ + const double top_left_value = +0.25 * (art[left_index] + art[top_index]); /* Top Left */ \ + const double top_right_value = -0.25 * (art[right_index] + art[top_index]); /* Top Right */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::BottomLeft]; \ + col = bottom_left_index; \ + val = bottom_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::BottomRight]; \ + col = bottom_right_index; \ + val = bottom_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::TopLeft]; \ + col = top_left_index; \ + val = top_left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::TopRight]; \ + col = top_right_index; \ + val = top_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + /* -------------------------- */ \ + /* Node on the inner boundary */ \ + /* -------------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + const int center_index = grid.index(i_r, i_theta); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + grid.ntheta()/2). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + assert(grid_.ntheta() % 2 == 0); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + grid.ntheta() / 2); \ + \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta_M1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int center_index = grid.index(i_r, i_theta); \ + const int left_index = grid.index(i_r, i_theta_AcrossOrigin); \ + const int right_index = grid.index(i_r + 1, i_theta); \ + const int bottom_index = grid.index(i_r, i_theta_M1); \ + const int top_index = grid.index(i_r, i_theta_P1); \ + const int bottom_right_index = grid.index(i_r + 1, i_theta_M1); \ + const int top_right_index = grid.index(i_r + 1, i_theta_P1); \ + \ + const double left_value = -coeff1 * (arr[center_index] + arr[left_index]); /* Left */ \ + const double right_value = -coeff2 * (arr[center_index] + arr[right_index]); /* Right */ \ + const double bottom_value = -coeff3 * (att[center_index] + att[bottom_index]); /* Bottom */ \ + const double top_value = -coeff4 * (att[center_index] + att[top_index]); /* Top */ \ + \ + const double center_value = \ + (+0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center_index]) /* beta_{i,j} */ \ + - left_value /* Center: (Left) */ \ + - right_value /* Center: (Right) */ \ + - bottom_value /* Center: (Bottom) */ \ + - top_value /* Center: (Top) */ \ + ); \ + \ + const double bottom_right_value = +0.25 * (art[right_index] + art[bottom_index]); /* Bottom Right */ \ + const double top_right_value = -0.25 * (art[right_index] + art[top_index]); /* Top Right */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Right]; \ + col = right_index; \ + val = right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* BottomLeft: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + offset = CenterStencil[StencilPosition::BottomRight]; \ + col = bottom_right_index; \ + val = bottom_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + \ + /* TopLeft: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + offset = CenterStencil[StencilPosition::TopRight]; \ + col = top_right_index; \ + val = top_right_value; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + } \ + /* ------------------------------------ */ \ + /* Node on the outer dirichlet boundary */ \ + /* ------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + const int center_index = grid.index(i_r, i_theta); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + UPDATE_MATRIX_ELEMENT(solver_matrix, offset, row, col, val); \ + } \ + } while (0) + +void DirectSolverTakeCustomLU::buildSolverMatrixCircleSection(const int i_r, SparseMatrixCSR& solver_matrix) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_TAKE(i_r, i_theta, grid_, DirBC_Interior_, solver_matrix, arr, att, art, detDF, + coeff_beta); + } +} + +void DirectSolverTakeCustomLU::buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCSR& solver_matrix) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + // Build solver matrix at the current node + NODE_BUILD_SOLVER_MATRIX_TAKE(i_r, i_theta, grid_, DirBC_Interior_, solver_matrix, arr, att, art, detDF, + coeff_beta); + } +} + +// clang-format off + +/* ------------------------------------------------------------------------ */ +/* If the indexing is not smoother-based, please adjust the access patterns */ +SparseMatrixCSR DirectSolverTakeCustomLU::buildSolverMatrix() +{ + omp_set_num_threads(num_omp_threads_); + + const int n = grid_.numberOfNodes(); + + std::function nnz_per_row = [&](int global_index) { + return getStencilSize(global_index); + }; + + SparseMatrixCSR solver_matrix(n, n, nnz_per_row); + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + else { + /* Multi-threaded execution */ + #pragma omp parallel + { + /* Circle Section */ + #pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildSolverMatrixCircleSection(i_r, solver_matrix); + } + /* Radial Section */ + #pragma omp for nowait + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildSolverMatrixRadialSection(i_theta, solver_matrix); + } + } + } + + return solver_matrix; +} +// clang-format on \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTakeCustomLU/directSolverTake.cpp b/src/DirectSolver/DirectSolverTakeCustomLU/directSolverTake.cpp new file mode 100644 index 00000000..a3ea522d --- /dev/null +++ b/src/DirectSolver/DirectSolverTakeCustomLU/directSolverTake.cpp @@ -0,0 +1,20 @@ +#include "../../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" + +DirectSolverTakeCustomLU::DirectSolverTakeCustomLU(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + bool DirBC_Interior, int num_omp_threads) + : DirectSolver(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ + solver_matrix_ = buildSolverMatrix(); + lu_solver_ = SparseLUSolver(solver_matrix_); +} + +void DirectSolverTakeCustomLU::solveInPlace(Vector& solution) +{ + lu_solver_.solveInPlace(solution); +} + +DirectSolverTakeCustomLU::~DirectSolverTakeCustomLU() +{ +} \ No newline at end of file diff --git a/src/DirectSolver/DirectSolverTakeCustomLU/matrixStencil.cpp b/src/DirectSolver/DirectSolverTakeCustomLU/matrixStencil.cpp new file mode 100644 index 00000000..41b00e66 --- /dev/null +++ b/src/DirectSolver/DirectSolverTakeCustomLU/matrixStencil.cpp @@ -0,0 +1,68 @@ +#include "../../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" + +int DirectSolverTakeCustomLU::getStencilSize(int global_index) const +{ + int i_r, i_theta; + grid_.multiIndex(global_index, i_r, i_theta); + + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 9 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 9; + const int size_stencil_outer_boundary = 1; + + if ((i_r > 1 && i_r < grid_.nr() - 2) || (i_r == 1 && !DirBC_Interior_)) { + return size_stencil_interior; + } + else if (i_r == 0 && !DirBC_Interior_) { + return size_stencil_inner_boundary; + } + else if ((i_r == 0 && DirBC_Interior_) || i_r == grid_.nr() - 1) { + return size_stencil_outer_boundary; + } + else if (i_r == 1 && DirBC_Interior_) { + return size_stencil_next_inner_boundary; + } + else if (i_r == grid_.nr() - 2) { + return size_stencil_next_outer_boundary; + } + throw std::out_of_range("Invalid index for stencil"); +} + +const Stencil& DirectSolverTakeCustomLU::getStencil(int i_r) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + assert(grid_.nr() >= 4); + + if ((i_r > 1 && i_r < grid_.nr() - 2) || (i_r == 1 && !DirBC_Interior_)) { + return stencil_interior_; + } + else if (i_r == 0 && !DirBC_Interior_) { + return stencil_across_origin_; + } + else if ((i_r == 0 && DirBC_Interior_) || i_r == grid_.nr() - 1) { + return stencil_DB_; + } + else if (i_r == 1 && DirBC_Interior_) { + return stencil_next_inner_DB_; + } + else if (i_r == grid_.nr() - 2) { + return stencil_next_outer_DB_; + } + throw std::out_of_range("Invalid index for stencil"); +} + +int DirectSolverTakeCustomLU::getNonZeroCountSolverMatrix() const +{ + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 7; + const int size_stencil_next_inner_boundary = DirBC_Interior_ ? 9 : 9; + const int size_stencil_interior = 9; + const int size_stencil_next_outer_boundary = 9; + const int size_stencil_outer_boundary = 1; + + assert(grid_.nr() >= 4); + + return grid_.ntheta() * + (size_stencil_inner_boundary + size_stencil_next_inner_boundary + (grid_.nr() - 4) * size_stencil_interior + + size_stencil_next_outer_boundary + size_stencil_outer_boundary); +} diff --git a/src/DirectSolver/directSolver.cpp b/src/DirectSolver/directSolver.cpp new file mode 100644 index 00000000..b1676a8f --- /dev/null +++ b/src/DirectSolver/directSolver.cpp @@ -0,0 +1,13 @@ +#include "../../include/DirectSolver/directSolver.h" + +DirectSolver::DirectSolver(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : grid_(grid) + , level_cache_(level_cache) + , domain_geometry_(domain_geometry) + , density_profile_coefficients_(density_profile_coefficients) + , DirBC_Interior_(DirBC_Interior) + , num_omp_threads_(num_omp_threads) +{ +} \ No newline at end of file diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.cpp new file mode 100644 index 00000000..ccd37a66 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/buildAscMatrices.cpp @@ -0,0 +1,1489 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" + +#include "../../../include/common/geometry_helper.h" + +/* Tridiagonal matrices */ +#define UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value) \ + do { \ + if (row == column) \ + matrix.main_diagonal(row) += value; \ + else if (row == column - 1) \ + matrix.sub_diagonal(row) += value; \ + else if (row == 0 && column == matrix.columns() - 1) \ + matrix.cyclic_corner_element() += value; \ + } while (0) + +/* Diagonal matrices */ +#define UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value) \ + do { \ + matrix.diagonal(row) += value; \ + } while (0) + +/* Inner Boundary COO/CSR matrix */ +#ifdef GMGPOLAR_USE_MUMPS + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_index(ptr + offset) = row; \ + matrix.col_index(ptr + offset) = col; \ + matrix.value(ptr + offset) += val; \ + } while (0) +#else + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_nz_index(row, offset) = col; \ + matrix.row_nz_entry(row, offset) += val; \ + } while (0) +#endif + +#define NODE_BUILD_SMOOTHER_GIVE(i_r, i_theta, grid, DirBC_Interior, inner_boundary_circle_matrix, \ + circle_diagonal_solver, circle_tridiagonal_solver, radial_diagonal_solver, \ + radial_tridiagonal_solver) \ + do { \ + assert(i_r >= 0 && i_r < grid.nr()); \ + assert(i_theta >= 0 && i_theta < grid.ntheta()); \ + \ + const int numberSmootherCircles = grid.numberSmootherCircles(); \ + const int lengthSmootherRadial = grid.lengthSmootherRadial(); \ + \ + assert(numberSmootherCircles >= 3); \ + assert(lengthSmootherRadial >= 3); \ + \ + int ptr, offset; \ + int row, column, col; \ + double value, val; \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Circle Section */ \ + /* ------------------------------------------ */ \ + if (i_r > 0 && i_r < numberSmootherCircles - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + int center_index = i_theta; \ + int left_index = i_theta; \ + int right_index = i_theta; \ + int bottom_index = i_theta_M1; \ + int top_index = i_theta_P1; \ + /* -------------------------- */ \ + /* Cyclic Tridiagonal Section */ \ + /* i_r % 2 == 1 */ \ + if (i_r & 1) { \ + /* i_theta % 2 == 1 */ \ + /* | X | O | X | */ \ + /* | | | | */ \ + /* | 0 | Õ | O | */ \ + /* | | | | */ \ + /* | X | O | X | */ \ + /* or */ \ + /* i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | X | Õ | X | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + auto& center_matrix = circle_tridiagonal_solver[i_r / 2]; \ + auto& left_matrix = circle_diagonal_solver[(i_r - 1) / 2]; \ + auto& right_matrix = circle_diagonal_solver[(i_r + 1) / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = bottom_index; \ + value = -coeff3 * att; /* Bottom */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = top_index; \ + value = -coeff4 * att; /* Top */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = center_index; \ + value = -coeff3 * att; /* Top */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = center_index; \ + value = -coeff4 * att; /* Bottom */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* | X | O | X | */ \ + /* | | | | */ \ + /* | 0 | Õ | O | */ \ + /* | | | | */ \ + /* | X | O | X | */ \ + \ + /* Fill matrix row of (i-1,j) */ \ + if (i_r == 1) { \ + /* Only in the case of AcrossOrigin */ \ + if (!DirBC_Interior) { \ + row = left_index; \ + ptr = getCircleAscIndex(i_r - 1, i_theta); \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1, i_theta); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + } \ + } \ + else { \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_DIAGONAL_ELEMENT(left_matrix, row, column, value); \ + } \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_DIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + } \ + /* ---------------- */ \ + /* Diagonal Section */ \ + /* i_r % 2 == 0 */ \ + else { \ + /* i_theta % 2 == 1 */ \ + /* | O | X | O | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | O | X | O | */ \ + /* or */ \ + /* i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | O | X̃ | O | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + auto& center_matrix = circle_diagonal_solver[i_r / 2]; \ + auto& left_matrix = circle_tridiagonal_solver[(i_r - 1) / 2]; \ + auto& right_matrix = circle_tridiagonal_solver[(i_r + 1) / 2]; \ + \ + if (i_theta & 1) { /* i_theta % 2 == 1 */ \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + else { /* i_theta % 2 == 0 */ \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + } \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Radial Section */ \ + /* ------------------------------------------ */ \ + else if (i_r > numberSmootherCircles && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + int center_index = i_r - numberSmootherCircles; \ + int left_index = i_r - numberSmootherCircles - 1; \ + int right_index = i_r - numberSmootherCircles + 1; \ + int bottom_index = i_r - numberSmootherCircles; \ + int top_index = i_r - numberSmootherCircles; \ + /* ------------------- */ \ + /* Tridiagonal Section */ \ + /* i_theta % 2 == 1 */ \ + if (i_theta & 1) { \ + /* i_r % 2 == 1 */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* or */ \ + /* i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + \ + auto& center_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_diagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_diagonal_solver[i_theta_P1 / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * arr; /* Left */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * arr; /* Right */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = center_index; \ + value = -coeff1 * arr; /* Right */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = center_index; \ + value = -coeff2 * arr; /* Left */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + if (i_r & 1) { /* i_r % 2 == 1 */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_DIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_DIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + } \ + /* ---------------- */ \ + /* Diagonal Section */ \ + /* i_theta % 2 == 0 */ \ + else { \ + /* i_r % 2 == 1 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* X Õ X */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* or */ \ + /* i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* O X̃ O */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + \ + auto& center_matrix = radial_diagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1 / 2]; \ + if (i_r & 1) { /* i_r % 2 == 1 */ \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + else { /* i_r % 2 == 0 */ \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + } \ + /* ------------------------------------------ */ \ + /* Circle Section: Node in the inner boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + /* Fill result(i,j) */ \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + \ + int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + auto& center_matrix = inner_boundary_circle_matrix; \ + auto& right_matrix = circle_tridiagonal_solver[(i_r + 1) / 2]; \ + \ + int center_index = i_theta; \ + int right_index = i_theta; \ + int bottom_index = i_theta_M1; \ + int top_index = i_theta_P1; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = getCircleAscIndex(i_r, i_theta); \ + \ + const Stencil& CenterStencil = getStencil(i_r, i_theta); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + (grid.ntheta() / 2)); \ + \ + const int center_index = i_theta; \ + const int left_index = i_theta_AcrossOrigin; \ + const int right_index = i_theta; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + const int center_nz_index = getCircleAscIndex(i_r, i_theta); \ + const int bottom_nz_index = getCircleAscIndex(i_r, i_theta_M1); \ + const int top_nz_index = getCircleAscIndex(i_r, i_theta_P1); \ + const int left_nz_index = getCircleAscIndex(i_r, i_theta_AcrossOrigin); \ + \ + int nz_index; \ + const Stencil& CenterStencil = getStencil(i_r, i_theta); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -| X | O | X | */ \ + /* -| | | | */ \ + /* -| Õ | O | O | */ \ + /* -| | | | */ \ + /* -| X | O | X | */ \ + \ + auto& center_matrix = inner_boundary_circle_matrix; \ + auto& right_matrix = circle_tridiagonal_solver[(i_r + 1) / 2]; \ + auto& left_matrix = inner_boundary_circle_matrix; \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + /* From view the view of the across origin node, */ \ + /* the directions are roatated by 180 degrees in the stencil! */ \ + row = left_index; \ + ptr = left_nz_index; \ + \ + const Stencil& LeftStencil = CenterStencil; \ + \ + offset = LeftStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right -> Left*/ \ + COO_CSR_UPDATE(left_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) -> Center: (Left) */ \ + COO_CSR_UPDATE(left_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* -| O | O | O | */ \ + /* -| | | | */ \ + /* -| X̃ | O | X | */ \ + /* -| | | | */ \ + /* -| O | O | O | */ \ + \ + auto& center_matrix = inner_boundary_circle_matrix; \ + auto& right_matrix = circle_tridiagonal_solver[(i_r + 1) / 2]; \ + auto& left_matrix = inner_boundary_circle_matrix; \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + ptr = bottom_nz_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + ptr = top_nz_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + COO_CSR_UPDATE(center_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + } \ + } \ + /* ------------------------------------------- */ \ + /* Circle Section: Node next to radial section */ \ + /* ------------------------------------------- */ \ + else if (i_r == numberSmootherCircles - 1) { \ + assert(i_r > 1); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + int center_index = i_theta; \ + int left_index = i_theta; \ + int right_index = 0; \ + int bottom_index = i_theta_M1; \ + int top_index = i_theta_P1; \ + \ + if (i_r & 1) { \ + if (i_theta & 1) { \ + /* i_r % 2 == 1 and i_theta % 2 == 1 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | Õ || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + \ + auto& center_matrix = circle_tridiagonal_solver[i_r / 2]; \ + auto& left_matrix = circle_diagonal_solver[(i_r - 1) / 2]; \ + auto& right_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = bottom_index; \ + value = -coeff3 * att; /* Bottom */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = top_index; \ + value = -coeff4 * att; /* Top */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = center_index; \ + value = -coeff3 * att; /* Top */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = center_index; \ + value = -coeff4 * att; /* Bottom */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_DIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + else { \ + /* i_r % 2 == 1 and i_theta % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | 0 | X | Õ || X O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + \ + auto& center_matrix = circle_tridiagonal_solver[i_r / 2]; \ + auto& left_matrix = circle_diagonal_solver[(i_r - 1) / 2]; \ + auto& right_matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = bottom_index; \ + value = -coeff3 * att; /* Bottom */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = top_index; \ + value = -coeff4 * att; /* Top */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = center_index; \ + value = -coeff3 * att; /* Top */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = center_index; \ + value = -coeff4 * att; /* Bottom */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + } \ + else { \ + if (i_theta & 1) { \ + /* i_r % 2 == 0 and i_theta % 2 == 1 */ \ + /* | X | O | X || O X O X */ \ + /* | | | || -------------- */ \ + /* | 0 | O | Õ || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || O X O X */ \ + \ + auto& center_matrix = circle_diagonal_solver[i_r / 2]; \ + auto& left_matrix = circle_tridiagonal_solver[(i_r - 1) / 2]; \ + auto& right_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + else { \ + /* i_r % 2 == 0 and i_theta % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X̃ || O X O X */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + \ + auto& center_matrix = circle_diagonal_solver[i_r / 2]; \ + auto& left_matrix = circle_tridiagonal_solver[(i_r - 1) / 2]; \ + auto& right_matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_DIAGONAL_ELEMENT(right_matrix, row, column, value); \ + } \ + } \ + } \ + /* --------------------------------------------- */ \ + /* Radial Section: Node next to circular section */ \ + /* --------------------------------------------- */ \ + else if (i_r == numberSmootherCircles) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_theta; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + const int bottom_index = i_r - numberSmootherCircles; \ + const int top_index = i_r - numberSmootherCircles; \ + \ + if (i_theta & 1) { \ + if (i_r & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* | X | O | X || O X O X */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || O X O X */ \ + \ + auto& center_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_diagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_diagonal_solver[i_theta_P1 / 2]; \ + auto& left_matrix = circle_diagonal_solver[(i_r - 1) / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * arr; /* Right */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_DIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = center_index; \ + value = -coeff2 * arr; /* Left */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_DIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_DIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + \ + auto& center_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_diagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_diagonal_solver[i_theta_P1 / 2]; \ + auto& left_matrix = circle_tridiagonal_solver[(i_r - 1) / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * arr; /* Right */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = center_index; \ + value = -coeff2 * arr; /* Left */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + } \ + else { \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || Õ X O X */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + \ + auto& center_matrix = radial_diagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1 / 2]; \ + auto& left_matrix = circle_diagonal_solver[(i_r - 1) / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = \ + (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X̃ O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + \ + auto& center_matrix = radial_diagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1 / 2]; \ + auto& left_matrix = circle_tridiagonal_solver[(i_r - 1) / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + } \ + } \ + /* ------------------------------------------- */ \ + /* Radial Section: Node next to outer boundary */ \ + /* ------------------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + assert(i_r % 2 == 1); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + int center_index = i_r - numberSmootherCircles; \ + int left_index = i_r - numberSmootherCircles - 1; \ + int right_index = i_r - numberSmootherCircles + 1; \ + int bottom_index = i_r - numberSmootherCircles; \ + int top_index = i_r - numberSmootherCircles; \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + /* O O Õ O || */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + auto& center_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_diagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_diagonal_solver[i_theta_P1 / 2]; \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * arr; /* Left */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Remark: Right is not included here due to the symmetry shift */ \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = center_index; \ + value = -coeff1 * arr; /* Right */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + /* Nothing to be done */ \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_DIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_DIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + /* O X Õ X || */ \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + auto& center_matrix = radial_diagonal_solver[i_theta / 2]; \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1 / 2]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1 / 2]; \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(top_matrix, row, column, value); \ + } \ + } \ + /* ------------------------------------------ */ \ + /* Radial Section: Node on the outer boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + assert(!i_r % 2 == 0); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + \ + int center_index = i_r - numberSmootherCircles; \ + int left_index = i_r - numberSmootherCircles - 1; \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + /* O O Õ || */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + auto& center_matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_TRIDIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + /* X O X̃ || */ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + auto& center_matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_DIAGONAL_ELEMENT(center_matrix, row, column, value); \ + } \ + } \ + } while (0) + +void ExtrapolatedSmootherGive::buildAscCircleSection(const int i_r) +{ + const double r = grid_.radius(i_r); + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int global_index = grid_.index(i_r, i_theta); + const double theta = grid_.theta(i_theta); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build Asc at the current node + NODE_BUILD_SMOOTHER_GIVE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_diagonal_solver_, circle_tridiagonal_solver_, radial_diagonal_solver_, + radial_tridiagonal_solver_); + } +} + +void ExtrapolatedSmootherGive::buildAscRadialSection(const int i_theta) +{ + const double theta = grid_.theta(i_theta); + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int global_index = grid_.index(i_r, i_theta); + const double r = grid_.radius(i_r); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build Asc at the current node + NODE_BUILD_SMOOTHER_GIVE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_diagonal_solver_, circle_tridiagonal_solver_, radial_diagonal_solver_, + radial_tridiagonal_solver_); + } +} + +// clang-format off +void ExtrapolatedSmootherGive::buildAscMatrices() +{ + omp_set_num_threads(num_omp_threads_); + + /* -------------------------------------- */ + /* Part 1: Allocate Asc Smoother matrices */ + /* -------------------------------------- */ + + const int number_smoother_circles = grid_.numberSmootherCircles(); + const int length_smoother_radial = grid_.lengthSmootherRadial(); + + const int num_circle_nodes = grid_.ntheta(); + circle_tridiagonal_solver_.resize(number_smoother_circles / 2); + circle_diagonal_solver_.resize(number_smoother_circles - number_smoother_circles / 2); + + assert((grid_.ntheta() / 2) % 2 == 0); + const int num_radial_nodes = length_smoother_radial; + radial_tridiagonal_solver_.resize(grid_.ntheta() / 2); + radial_diagonal_solver_.resize(grid_.ntheta() / 2); + + // Remark: circle_diagonal_solver_[0] is undefnied. + // Use inner_boundary_circle_matrix_ instead. + #pragma omp parallel if (grid_.numberOfNodes() > 10'000) + { + // ---------------- // + // Circular Section // + #pragma omp for nowait + for (int circle_Asc_index = 0; circle_Asc_index < number_smoother_circles; circle_Asc_index++) { + + /* Inner boundary circle */ + if (circle_Asc_index == 0) { + #ifdef GMGPOLAR_USE_MUMPS + // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. + const int nnz = getNonZeroCountCircleAsc(circle_Asc_index); + inner_boundary_circle_matrix_ = SparseMatrixCOO(num_circle_nodes, num_circle_nodes, nnz); + inner_boundary_circle_matrix_.is_symmetric(false); + for (int i = 0; i < nnz; i++) { + inner_boundary_circle_matrix_.value(i) = 0.0; + } + #else + std::function nnz_per_row = [&](int i_theta) { + if(DirBC_Interior_) return 1; + else return i_theta % 2 == 0 ? 1 : 2; + }; + inner_boundary_circle_matrix_ = SparseMatrixCSR(num_circle_nodes, num_circle_nodes, nnz_per_row); + for (int i = 0; i < inner_boundary_circle_matrix_.non_zero_size(); i++) { + inner_boundary_circle_matrix_.values_data()[i] = 0.0; + } + #endif + } + + /* Interior Circle Section */ + else { + if (circle_Asc_index & 1) { + const int circle_tridiagonal_solver_index = circle_Asc_index / 2; + auto& solver_matrix = circle_tridiagonal_solver_[circle_tridiagonal_solver_index]; + + solver_matrix = SymmetricTridiagonalSolver(num_circle_nodes); + solver_matrix.is_cyclic(true); + solver_matrix.cyclic_corner_element() = 0.0; + + for (int i = 0; i < num_circle_nodes; i++) { + solver_matrix.main_diagonal(i) = 0.0; + if (i < num_circle_nodes - 1) { + solver_matrix.sub_diagonal(i) = 0.0; + } + } + } + else { + const int circle_diagonal_solver_index = circle_Asc_index / 2; + auto& solver_matrix = circle_diagonal_solver_[circle_diagonal_solver_index]; + + solver_matrix = DiagonalSolver(num_circle_nodes); + + for (int i = 0; i < num_circle_nodes; i++) { + solver_matrix.diagonal(i) = 0.0; + } + } + } + } + + // -------------- // + // Radial Section // + #pragma omp for nowait + for (int radial_Asc_index = 0; radial_Asc_index < grid_.ntheta(); radial_Asc_index++) { + + if (radial_Asc_index & 1) { + const int radial_tridiagonal_solver_index = radial_Asc_index / 2; + auto& solver_matrix = radial_tridiagonal_solver_[radial_tridiagonal_solver_index]; + + solver_matrix = SymmetricTridiagonalSolver(num_radial_nodes); + solver_matrix.is_cyclic(false); + + for (int i = 0; i < num_radial_nodes; i++) { + solver_matrix.main_diagonal(i) = 0.0; + if (i < num_radial_nodes - 1) { + solver_matrix.sub_diagonal(i) = 0.0; + } + } + } + else { + const int radial_diagonal_solver_index = radial_Asc_index / 2; + auto& solver_matrix = radial_diagonal_solver_[radial_diagonal_solver_index]; + + solver_matrix = DiagonalSolver(num_radial_nodes); + + for (int i = 0; i < num_radial_nodes; i++) { + solver_matrix.diagonal(i) = 0.0; + } + } + } + } + + /* ---------------------------------- */ + /* Part 2: Fill Asc Smoother matrices */ + /* ---------------------------------- */ + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildAscCircleSection(i_r); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildAscRadialSection(i_theta); + } + } + else { + /* Multi-threaded execution: For Loops */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int additional_radial_tasks = grid_.ntheta() % 3; + const int num_radial_tasks = grid_.ntheta() - additional_radial_tasks; + + #pragma omp parallel + { + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildAscCircleSection(i_r); + } + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildAscCircleSection(i_r); + } + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildAscCircleSection(i_r); + } + + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 0) { + int i_theta = radial_task + additional_radial_tasks; + buildAscRadialSection(i_theta); + } + else { + if (additional_radial_tasks == 0) { + buildAscRadialSection(0); + } + else if (additional_radial_tasks >= 1) { + buildAscRadialSection(0); + buildAscRadialSection(1); + } + } + } + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 1) { + int i_theta = radial_task + additional_radial_tasks; + buildAscRadialSection(i_theta); + } + else { + if (additional_radial_tasks == 0) { + buildAscRadialSection(1); + } + else if (additional_radial_tasks == 1) { + buildAscRadialSection(2); + } + else if (additional_radial_tasks == 2) { + buildAscRadialSection(2); + buildAscRadialSection(3); + } + } + } + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 3) { + int i_theta = radial_task + additional_radial_tasks; + buildAscRadialSection(i_theta); + } + } + } + + #ifdef GMGPOLAR_USE_MUMPS + /* ------------------------------------------------------------------- */ + /* Part 3: Convert inner_boundary_circle_matrix_ to a symmetric matrix */ + /* ------------------------------------------------------------------- */ + + SparseMatrixCOO full_matrix = std::move(inner_boundary_circle_matrix_); + + const int nnz = full_matrix.non_zero_size(); + const int numRows = full_matrix.rows(); + const int numColumns = full_matrix.columns(); + const int symmetric_nnz = nnz - (nnz - numRows) / 2; + + inner_boundary_circle_matrix_ = SparseMatrixCOO(numRows, numColumns, symmetric_nnz); + inner_boundary_circle_matrix_.is_symmetric(true); + + int current_nz = 0; + for (int nz_index = 0; nz_index < full_matrix.non_zero_size(); nz_index++) { + int current_row = full_matrix.row_index(nz_index); + int current_col = full_matrix.col_index(nz_index); + if (current_row <= current_col) { + inner_boundary_circle_matrix_.row_index(current_nz) = current_row; + inner_boundary_circle_matrix_.col_index(current_nz) = current_col; + inner_boundary_circle_matrix_.value(current_nz) = std::move(full_matrix.value(nz_index)); + current_nz++; + } + } + #endif +} +// clang-format on \ No newline at end of file diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.cpp new file mode 100644 index 00000000..e2f77940 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.cpp @@ -0,0 +1,30 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" + +ExtrapolatedSmootherGive::ExtrapolatedSmootherGive(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads) + : ExtrapolatedSmoother(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, + num_omp_threads) +{ + buildAscMatrices(); +#ifdef GMGPOLAR_USE_MUMPS + initializeMumpsSolver(inner_boundary_mumps_solver_, inner_boundary_circle_matrix_); +#else + inner_boundary_lu_solver_ = SparseLUSolver(inner_boundary_circle_matrix_); +#endif +} + +ExtrapolatedSmootherGive::~ExtrapolatedSmootherGive() +{ +#ifdef GMGPOLAR_USE_MUMPS + finalizeMumpsSolver(inner_boundary_mumps_solver_); +#endif +} + +void ExtrapolatedSmootherGive::extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) +{ + extrapolatedSmoothingForLoop(x, rhs, temp); /* This is the fastest option */ + // extrapolatedSmoothingTaskLoop(x, rhs, temp); + // extrapolatedSmoothingTaskDependencies(x, rhs, temp); +} \ No newline at end of file diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.cpp new file mode 100644 index 00000000..12c75472 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/initializeMumps.cpp @@ -0,0 +1,112 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" + +#ifdef GMGPOLAR_USE_MUMPS + +void ExtrapolatedSmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, + SparseMatrixCOO& solver_matrix) +{ + /* + * MUMPS (a parallel direct solver) uses 1-based indexing, + * whereas the input matrix follows 0-based indexing. + * Adjust row and column indices to match MUMPS' requirements. + */ + for (int i = 0; i < solver_matrix.non_zero_size(); i++) { + solver_matrix.row_index(i) += 1; + solver_matrix.col_index(i) += 1; + } + + mumps_solver.job = JOB_INIT; + mumps_solver.par = PAR_PARALLEL; + /* The matrix is positive definite for invertible mappings. */ + /* Therefore we use SYM_POSITIVE_DEFINITE instead of SYM_GENERAL_SYMMETRIC. */ + mumps_solver.sym = (solver_matrix.is_symmetric() ? SYM_POSITIVE_DEFINITE : SYM_UNSYMMETRIC); + mumps_solver.comm_fortran = USE_COMM_WORLD; + dmumps_c(&mumps_solver); + + mumps_solver.ICNTL(1) = 0; // Output stream for error messages. + mumps_solver.ICNTL(2) = 0; // Output stream for diagnostic printing and statistics local to each MPI process. + mumps_solver.ICNTL(3) = 0; // Output stream for global information, collected on the host + mumps_solver.ICNTL(4) = 0; // Level of printing for error, warning, and diagnostic messages. + mumps_solver.ICNTL(5) = 0; // Controls the matrix input format + mumps_solver.ICNTL(6) = 7; // Permutes the matrix to a zero-free diagonal and/or scale the matrix + mumps_solver.ICNTL(7) = + 5; // Computes a symmetric permutation (ordering) to determine the pivot order to be used for the factorization in case of sequential analysis + mumps_solver.ICNTL(8) = 77; // Describes the scaling strategy + mumps_solver.ICNTL(9) = 1; // Computes the solution using A or A^T + mumps_solver.ICNTL(10) = 0; // Applies the iterative refinement to the computed solution + mumps_solver.ICNTL(11) = 0; // Computes statistics related to an error analysis of the linear system solved + mumps_solver.ICNTL(12) = 0; // Defines an ordering strategy for symmetric matrices and is used + mumps_solver.ICNTL(13) = 0; // Controls the parallelism of the root node + mumps_solver.ICNTL(14) = // Controls the percentage increase in the estimated working space + (solver_matrix.is_symmetric() ? 5 : 20); + mumps_solver.ICNTL(15) = 0; // Exploits compression of the input matrix resulting from a block format + mumps_solver.ICNTL(16) = 0; // Controls the setting of the number of OpenMP threads + // ICNTL(17) Doesn't exist + mumps_solver.ICNTL(18) = 0; // Defines the strategy for the distributed input matrix + mumps_solver.ICNTL(19) = 0; // Computes the Schur complement matrix + mumps_solver.ICNTL(20) = 0; // Determines the format (dense, sparse, or distributed) of the right-hand sides + mumps_solver.ICNTL(21) = 0; // Determines the distribution (centralized or distributed) of the solution vectors. + mumps_solver.ICNTL(22) = 0; // Controls the in-core/out-of-core (OOC) factorization and solve. + mumps_solver.ICNTL(23) = 0; // Corresponds to the maximum size of the working memory in MegaBytes that MUMPS can + // allocate per working process + mumps_solver.ICNTL(24) = 0; // Controls the detection of “null pivot rows”. + mumps_solver.ICNTL(25) = + 0; // Allows the computation of a solution of a deficient matrix and also of a null space basis + mumps_solver.ICNTL(26) = 0; // Drives the solution phase if a Schur complement matrix has been computed + mumps_solver.ICNTL(27) = -32; // Controls the blocking size for multiple right-hand sides. + mumps_solver.ICNTL(28) = 0; // Determines whether a sequential or parallel computation of the ordering is performed + mumps_solver.ICNTL(29) = + 0; // Defines the parallel ordering tool (when ICNTL(28)=1) to be used to compute the fill-in reducing permutation. + mumps_solver.ICNTL(30) = 0; // Computes a user-specified set of entries in the inverse A^−1 of the original matrix + mumps_solver.ICNTL(31) = 0; // Indicates which factors may be discarded during the factorization. + mumps_solver.ICNTL(32) = 0; // Performs the forward elimination of the right-hand sides during the factorization + mumps_solver.ICNTL(33) = 0; // Computes the determinant of the input matrix. + mumps_solver.ICNTL(34) = 0; // Controls the conservation of the OOC files during JOB= –3 + mumps_solver.ICNTL(35) = 0; // Controls the activation of the BLR feature + mumps_solver.ICNTL(36) = 0; // Controls the choice of BLR factorization variant + mumps_solver.ICNTL(37) = 0; // Controls the BLR compression of the contribution blocks + mumps_solver.ICNTL(38) = 600; // Estimates compression rate of LU factors + mumps_solver.ICNTL(39) = 500; // Estimates compression rate of contribution blocks + // ICNTL(40-47) Don't exist + mumps_solver.ICNTL(48) = 1; // Multithreading with tree parallelism + mumps_solver.ICNTL(49) = 0; // Compact workarray id%S at the end of factorization phase + // ICNTL(50-55) Don't exist + mumps_solver.ICNTL(56) = + 0; // Detects pseudo-singularities during factorization and factorizes the root node with a rankrevealing method + // ICNTL(57) Doesn't exist + mumps_solver.ICNTL(58) = 2; // Defines options for symbolic factorization + // ICNTL(59-60) Don't exist + + mumps_solver.CNTL(1) = -1.0; // Relative threshold for numerical pivoting + mumps_solver.CNTL(2) = -1.0; // Stopping criterion for iterative refinement + mumps_solver.CNTL(3) = 0.0; // Determine null pivot rows + mumps_solver.CNTL(4) = -1.0; // Determines the threshold for static pivoting + mumps_solver.CNTL(5) = + 0.0; // Defines the fixation for null pivots and is effective only when null pivot row detection is active + // CNTL(6) Doesn't exist + mumps_solver.CNTL(7) = 0.0; // Defines the precision of the dropping parameter used during BLR compression + // CNTL(8-15) Don't exist + + mumps_solver.job = JOB_ANALYSIS_AND_FACTORIZATION; + assert(solver_matrix.rows() == solver_matrix.columns()); + mumps_solver.n = solver_matrix.rows(); + mumps_solver.nz = solver_matrix.non_zero_size(); + mumps_solver.irn = solver_matrix.row_indices_data(); + mumps_solver.jcn = solver_matrix.column_indices_data(); + mumps_solver.a = solver_matrix.values_data(); + dmumps_c(&mumps_solver); + + if (mumps_solver.sym == SYM_POSITIVE_DEFINITE && mumps_solver.INFOG(12) != 0) { + std::cout << "Warning: ExtrapolatedSmoother inner boundary matrix is not positive definite: Negative pivots in " + "the factorization phase." + << std::endl; + } +} + +void ExtrapolatedSmootherGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +{ + mumps_solver.job = JOB_END; + dmumps_c(&mumps_solver); +} + +#endif \ No newline at end of file diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherSolver.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherSolver.cpp new file mode 100644 index 00000000..720418b7 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherSolver.cpp @@ -0,0 +1,1214 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" + +#include "../../../include/common/geometry_helper.h" + +// The current position is marked with a ~ symbol. +#define NODE_APPLY_ASC_ORTHO_CIRCLE_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, \ + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta) \ + do { \ + assert(i_r >= 0 && i_r <= grid_.numberSmootherCircles()); \ + bool isOddNumberSmootherCircles = (grid.numberSmootherCircles() & 1); \ + bool isOddRadialIndex = (i_r & 1); \ + SmootherColor node_color = \ + (isOddNumberSmootherCircles == isOddRadialIndex) ? SmootherColor::White : SmootherColor::Black; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 0 && i_r < grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_r & 1) { \ + if (i_theta & 1) { \ + /* i_r % 2 == 1 and i_theta % 2 == 1 */ \ + /* | X | O | X | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | X | O | X | */ \ + \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + ); \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (+0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + else { \ + /* i_r % 2 == 1 and i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | X | Õ | X | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + ); \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (+0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + else { \ + if (i_theta & 1) { \ + /* i_r % 2 == 0 and i_theta % 2 == 1 */ \ + /* | O | X | O | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | O | X | O | */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + } \ + else { \ + /* i_r % 2 == 0 and i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | O | X̃ | O | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + if (i_r & 1) { \ + if (i_theta & 1) { \ + /* i_r % 2 == 1 and i_theta % 2 == 1 */ \ + /* | X | O | X | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | X | O | X | */ \ + \ + /* Fill temp(i-1,j) */ \ + if (i_r > 1 || !DirBC_Interior) { \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + /* Fill temp(i+1,j) */ \ + if (i_r < grid.numberSmootherCircles() - 1) { \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + else { \ + /* i_r % 2 == 1 and i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | X | Õ | X | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + /* Nothing to do! */ \ + } \ + } \ + else { \ + if (i_theta & 1) { \ + /* i_r % 2 == 0 and i_theta % 2 == 1 */ \ + /* | O | X | O | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | O | X | O | */ \ + \ + /* Fill temp(i-1,j) */ \ + if (i_r > 1 || !DirBC_Interior) { \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + /* Fill temp(i+1,j) */ \ + if (i_r < grid.numberSmootherCircles() - 1) { \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + else { \ + /* i_r % 2 == 0 and i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | O | X̃ | O | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + /* Fill temp(i-1,j) */ \ + if (i_r > 1 || !DirBC_Interior) { \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + /* Fill temp(i+1,j) */ \ + if (i_r < grid.numberSmootherCircles() - 1) { \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + } \ + } \ + } \ + /* -------------------- */ \ + /* Node on the boundary */ \ + /* -------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* || X | O | X | */ \ + /* || | | | */ \ + /* || Õ | O | O | */ \ + /* || | | | */ \ + /* || X | O | X | */ \ + /* Nothing to do! */ \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* || O | O | O | */ \ + /* || | | | */ \ + /* || X̃ | O | X | */ \ + /* || | | | */ \ + /* || O | O | O | */ \ + /* Nothing to do! */ \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -| X | O | X | */ \ + /* -| | | | */ \ + /* -| Õ | O | O | */ \ + /* -| | | | */ \ + /* -| X | O | X | */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (/* - coeff1 * arr * x[grid.index(i_r, i_theta + (grid.ntheta()/2))] // Left: Not in Asc_ortho */ \ + -coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* -| O | O | O | */ \ + /* -| | | | */ \ + /* -| X̃ | O | X | */ \ + /* -| | | | */ \ + /* -| O | O | O | */ \ + \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)]); /* Top Right */ \ + /* + 0.25 * art * x[grid.index(i_r-1,i_theta)]; // Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)]); /* Bottom Right */ \ + /* - 0.25 * art * x[grid.index(i_r-1,i_theta)]; // Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + } \ + /* ----------------------------- */ \ + /* Node next to circular section */ \ + /* ----------------------------- */ \ + else if (i_r == grid.numberSmootherCircles()) { \ + assert(node_color == SmootherColor::White); \ + if (smoother_color == SmootherColor::Black) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* | X | O | X || O X O X */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || O X O X */ \ + /* -> Give Left */ \ + \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + /* -> Give Left */ \ + \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || Õ X O X */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + /* -> Don't give to the Left! */ \ + \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X̃ O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + /* -> Give Left */ \ + \ + if (i_theta & 1 || !(i_r & 1)) { \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + } \ + } \ + } while (0) + +#define NODE_APPLY_ASC_ORTHO_RADIAL_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, \ + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta) \ + do { \ + assert(i_r >= grid.numberSmootherCircles() - 1 && i_r < grid.nr()); \ + SmootherColor node_color = (i_theta & 1) ? SmootherColor::White : SmootherColor::Black; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > grid.numberSmootherCircles() && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_theta & 1) { \ + if (i_r & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (+0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + else { \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (+0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + else { \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* X Õ X */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* O X̃ O */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + if (i_theta & 1) { \ + if (i_r & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + else { \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + \ + /* Nothing to do! */ \ + } \ + } \ + else { \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* X Õ X */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* O X̃ O */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + } \ + } \ + else if (i_r == grid.numberSmootherCircles() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Dont give to the right when this case occurs! */ \ + /* i_theta % 2 = 0 and i_r % 2 == 1 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | 0 | X | Õ || X O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + if ((!(i_r & 1) || (i_theta & 1))) { \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Nothing to be done here */ \ + } \ + } \ + else if (i_r == grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_theta & 1) { \ + if (i_r & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* | X | O | X || O X O X */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || O X O X */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (+0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + else { \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (+0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + else { \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || Õ X O X */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X̃ O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Dont give to bottom and up when this case occurs! */ \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + if (i_r & 1 || !(i_theta & 1)) { \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + } \ + else if (i_r == grid.nr() - 2) { \ + assert(i_r & 1); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + /* O O Õ O || */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= (-coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + \ + /* "Right" is part of the radial Asc smoother matrices, */ \ + /* but is shifted over to the rhs to make the radial Asc smoother matrices symmetric. */ \ + /* Note that the circle Asc smoother matrices are symmetric by default. */ \ + /* Note that rhs[grid.index(i_r + 1, i_theta)] contains the correct boundary value of u_D. */ \ + temp[grid.index(i_r, i_theta)] -= /* Right: Symmetry shift! */ \ + -coeff2 * arr * rhs[grid.index(i_r + 1, i_theta)]; \ + } \ + else { \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + /* O X Õ X || */ \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + else if (i_r == grid.nr() - 1) { \ + assert(!(i_r & 1)); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + /* O O Õ || */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)] /* Bottom Right */ \ + ); \ + /* "Right" is part of the radial Asc smoother matrices, */ \ + /* but is shifted over to the rhs to make the radial Asc smoother matrices symmetric. */ \ + /* Note that the circle Asc smoother matrices are symmetric by default. */ \ + /* Note that rhs[grid.index(i_r, i_theta)] contains the correct boundary value of u_D. */ \ + temp[grid.index(i_r - 1, i_theta)] -= (-coeff1 * arr * rhs[grid.index(i_r, i_theta)] /* Right */ \ + ); \ + } \ + else { \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + /* X O X̃ || */ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Nothing to be done here */ \ + } \ + } \ + } while (0) + +void ExtrapolatedSmootherGive::applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles() + 1); + + const auto& sin_theta_cache = level_cache_.sin_theta(); + const auto& cos_theta_cache = level_cache_.cos_theta(); + + const double r = grid_.radius(i_r); + + double coeff_beta; + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_beta = level_cache_.coeff_beta()[i_r]; + } + else { + coeff_beta = density_profile_coefficients_.beta(r); + } + + double coeff_alpha; + if (!level_cache_.cacheDomainGeometry()) { + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_alpha = level_cache_.coeff_alpha()[i_r]; + } + else { + coeff_alpha = density_profile_coefficients_.alpha(r); + } + } + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const double theta = grid_.theta(i_theta); + const double sin_theta = sin_theta_cache[i_theta]; + const double cos_theta = cos_theta_cache[i_theta]; + + /* Compute arr, att, art, detDF value at the current node */ + double arr, att, art, detDF; + if (level_cache_.cacheDomainGeometry()) { + const int index = grid_.index(i_r, i_theta); + arr = level_cache_.arr()[index]; + att = level_cache_.att()[index]; + art = level_cache_.art()[index]; + detDF = level_cache_.detDF()[index]; + } + else { + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + } + + // Apply Asc Ortho at the current node + NODE_APPLY_ASC_ORTHO_CIRCLE_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); + } +} + +void ExtrapolatedSmootherGive::applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, + Vector& temp) +{ + const auto& sin_theta_cache = level_cache_.sin_theta(); + const auto& cos_theta_cache = level_cache_.cos_theta(); + + const double theta = grid_.theta(i_theta); + const double sin_theta = sin_theta_cache[i_theta]; + const double cos_theta = cos_theta_cache[i_theta]; + + /* !!! i_r = grid_.numberSmootherCircles()-1 !!! */ + for (int i_r = grid_.numberSmootherCircles() - 1; i_r < grid_.nr(); i_r++) { + const double r = grid_.radius(i_r); + + double coeff_beta; + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_beta = level_cache_.coeff_beta()[i_r]; + } + else { + coeff_beta = density_profile_coefficients_.beta(r); + } + + double coeff_alpha; + if (!level_cache_.cacheDomainGeometry()) { + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_alpha = level_cache_.coeff_alpha()[i_r]; + } + else { + coeff_alpha = density_profile_coefficients_.alpha(r); + } + } + + /* Compute arr, att, art, detDF value at the current node */ + double arr, att, art, detDF; + if (level_cache_.cacheDomainGeometry()) { + const int index = grid_.index(i_r, i_theta); + arr = level_cache_.arr()[index]; + att = level_cache_.att()[index]; + art = level_cache_.art()[index]; + detDF = level_cache_.detDF()[index]; + } + else { + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + } + + // Apply Asc Ortho at the current node + NODE_APPLY_ASC_ORTHO_RADIAL_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); + } +} + +void ExtrapolatedSmootherGive::solveCircleSection(const int i_r, Vector& x, Vector& temp, + Vector& solver_storage_1, Vector& solver_storage_2) +{ + const int start = grid_.index(i_r, 0); + const int end = start + grid_.ntheta(); + if (i_r == 0) { +#ifdef GMGPOLAR_USE_MUMPS + inner_boundary_mumps_solver_.job = JOB_COMPUTE_SOLUTION; + inner_boundary_mumps_solver_.nrhs = 1; // single rhs vector + inner_boundary_mumps_solver_.nz_rhs = grid_.ntheta(); // non-zeros in rhs + inner_boundary_mumps_solver_.rhs = temp.begin() + start; + inner_boundary_mumps_solver_.lrhs = grid_.ntheta(); // leading dimension of rhs + dmumps_c(&inner_boundary_mumps_solver_); + if (inner_boundary_mumps_solver_.info[0] != 0) { + std::cerr << "Error solving the system: " << inner_boundary_mumps_solver_.info[0] << std::endl; + } +#else + inner_boundary_lu_solver_.solveInPlace(temp.begin() + start); +#endif + } + else { + if (i_r & 1) { + circle_tridiagonal_solver_[i_r / 2].solveInPlace(temp.begin() + start, solver_storage_1.begin(), + solver_storage_2.begin()); + } + else { + circle_diagonal_solver_[i_r / 2].solveInPlace(temp.begin() + start); + } + } + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +void ExtrapolatedSmootherGive::solveRadialSection(const int i_theta, Vector& x, Vector& temp, + Vector& solver_storage) +{ + const int start = grid_.index(grid_.numberSmootherCircles(), i_theta); + const int end = start + grid_.lengthSmootherRadial(); + if (i_theta & 1) { + radial_tridiagonal_solver_[i_theta / 2].solveInPlace(temp.begin() + start, solver_storage.begin()); + } + else { + radial_diagonal_solver_[i_theta / 2].solveInPlace(temp.begin() + start); + } + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +// Quick overview: +// Step 1: temp = rhs - Asc_ortho(x) +// Step 2: Solve in place +// Step 3: Update x + +/* ------------------ */ +/* Sequential Version */ +/* ------------------ */ + +void ExtrapolatedSmootherGive::extrapolatedSmoothingSequential(Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } + + /* Single-threaded execution */ + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + + /* ---------------------------- */ + /* ------ CIRCLE SECTION ------ */ + + /* The outer most circle next to the radial section is defined to be black. */ + /* Priority: Black -> White. */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles() + 1; i_r++) { + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + const int start_black_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 1 : 0; + for (int i_r = start_black_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + const int start_white_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 0 : 1; + for (int i_r = start_white_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + /* ---------------------------- */ + /* ------ RADIAL SECTION ------ */ + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta += 2) { + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + for (int i_theta = 1; i_theta < grid_.ntheta(); i_theta += 2) { + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } +} + +/* ------------------------------------ */ +/* Parallelization Version 1: For Loops */ +/* ------------------------------------ */ + +// clang-format off +void ExtrapolatedSmootherGive::extrapolatedSmoothingForLoop(Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + omp_set_num_threads(num_omp_threads_); + + if (omp_get_max_threads() == 1) { + extrapolatedSmoothingSequential(x, rhs, temp); + } + else { + + #pragma omp parallel + { + #pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } + #pragma omp for + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } + } + + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int num_radial_tasks = grid_.ntheta(); + + #pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + + /* ---------------------------- */ + /* ------ CIRCLE SECTION ------ */ + /* ---------------------------- */ + + /* ---------------------------- */ + /* Asc ortho Black Circle Tasks */ + + /* Inside Black Section */ + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + /* Outside Black Section (Part 1)*/ + #pragma omp for + for (int circle_task = -1; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + /* Outside Black Section (Part 2)*/ + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + + /* Black Circle Smoother */ + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* Inside White Section */ + #pragma omp for nowait + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* Inside Black Section */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* Outside White Section (Part 1)*/ + #pragma omp for nowait + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* Outside Black Section (Part 1) */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* Outside White Section (Part 2)*/ + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* Outside Black Section (Part 2) */ + #pragma omp for + for (int radial_task = 3; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + + /* White Circle Smoother */ + #pragma omp for nowait + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + /* Black Radial Smoother */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + + /* Inside White Section */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + /* Outside White Section (Part 1) */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + /* Outside White Section (Part 2) */ + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + + /* White Radial Smoother */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + } +} diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.cpp new file mode 100644 index 00000000..78a316fd --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/smootherStencil.cpp @@ -0,0 +1,75 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" + +const Stencil& ExtrapolatedSmootherGive::getStencil(int i_r, int i_theta) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + + assert((grid_.ntheta() / 2) % 2 == 0); + + if (i_r == 0) { + if (i_theta % 2 == 0) { + return stencil_center_; + } + else { + if (!DirBC_Interior_) { + return stencil_center_left_; + } + else { + return stencil_center_; + } + } + } + + throw std::out_of_range("getStencil: Only i_r = 0 implemented."); +} + +int ExtrapolatedSmootherGive::getNonZeroCountCircleAsc(const int i_r) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + assert((grid_.ntheta() / 2) % 2 == 0); + + if (i_r == 0) { + if (!DirBC_Interior_) { + return grid_.ntheta() / 2 + 2 * (grid_.ntheta() / 2); + } + else { + return grid_.ntheta(); + } + } + + throw std::out_of_range("nnz_circle_Asc: Only i_r = 0 implemented."); +} + +int ExtrapolatedSmootherGive::getCircleAscIndex(const int i_r, const int i_theta) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + assert((grid_.ntheta() / 2) % 2 == 0); + + if (i_r == 0) { + if (!DirBC_Interior_) { + if (i_theta % 2 == 0) { + return 3 * (i_theta / 2); + } + else { + return 3 * (i_theta / 2) + 1; + } + } + else { + return i_theta; + } + } + + throw std::out_of_range("ptr_nz_index_circle_Asc: Only i_r = 0 implemented."); +} + +int ExtrapolatedSmootherGive::getNonZeroCountRadialAsc(const int i_theta) const +{ + throw std::out_of_range("ExtrapolatedSmoother: nnz_radial_Asc not implemented."); +} + +int ExtrapolatedSmootherGive::getRadialAscIndex(const int i_r, const int i_theta) const +{ + throw std::out_of_range("ExtrapolatedSmoother: ptr_nz_index_radial_Asc not implemented."); +} diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/task_parallelization.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/task_parallelization.cpp new file mode 100644 index 00000000..a7b1885b --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherGive/task_parallelization.cpp @@ -0,0 +1,519 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" + +/* ------------------------------------ */ +/* Parallelization Version 2: Task Loop */ +/* ------------------------------------ */ + +void ExtrapolatedSmootherGive::extrapolatedSmoothingTaskLoop(Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + omp_set_num_threads(num_omp_threads_); + + if (omp_get_max_threads() == 1) { + extrapolatedSmoothingSequential(x, rhs, temp); + } + else { + +#pragma omp parallel + { +#pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } +#pragma omp for + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } + } + + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int num_radial_tasks = grid_.ntheta(); + + /* Idea: Scedule first_black_circle_smoother as fast as possible to start the radial section early. */ + int first_circle_black_Asc0, first_circle_black_Asc1, first_circle_black_Asc2; + int first_black_circle_smoother; + + int circle_black_Asc0, circle_black_Asc1, circle_black_Asc2; + int black_circle_smoother; + int circle_white_Asc0, circle_white_Asc1, circle_white_Asc2; + int white_circle_smoother; + + int radial_black_Asc0, radial_black_Asc1, radial_black_Asc2; + int black_radial_smoother; + int radial_white_Asc0, radial_white_Asc1, radial_white_Asc2; + int white_radial_smoother; + +#pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + +#pragma omp single + { + /* ---------------------------------- */ + /* ------ CIRCLE BLACK SECTION ------ */ + /* ---------------------------------- */ + + /* --------------- */ + /* First few lines */ + +#pragma omp task depend(out : first_circle_black_Asc0) + { +#pragma omp taskloop + for (int circle_task = 0; circle_task < std::min(6, num_circle_tasks); circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : first_circle_black_Asc0) depend(out : first_circle_black_Asc1) + { +#pragma omp taskloop + for (int circle_task = -1; circle_task < std::min(7, num_circle_tasks); circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : first_circle_black_Asc1) depend(out : first_circle_black_Asc2) + { +#pragma omp taskloop + for (int circle_task = 1; circle_task < std::min(5, num_circle_tasks); circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : first_circle_black_Asc2) depend(out : first_black_circle_smoother) + { +#pragma omp taskloop + for (int circle_task = 0; circle_task < std::min(2, num_circle_tasks); circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* -------------- */ + /* Leftover lines */ + +#pragma omp task depend(out : circle_black_Asc0) + { +#pragma omp taskloop + for (int circle_task = 6; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +// We don't need depend(in: first_circle_black_Asc0) since there is enough separation. +#pragma omp task depend(in : circle_black_Asc0) depend(out : circle_black_Asc1) + { +#pragma omp taskloop + for (int circle_task = 7; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_black_Asc1, first_circle_black_Asc1) depend(out : circle_black_Asc2) + { +#pragma omp taskloop + for (int circle_task = 5; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_black_Asc2, first_circle_black_Asc2) depend(out : black_circle_smoother) + { +#pragma omp taskloop + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------------- */ + /* ------ CIRCLE WHITE SECTION ------ */ + /* ---------------------------------- */ + +#pragma omp task depend(in : black_circle_smoother, first_black_circle_smoother) depend(out : circle_white_Asc0) + { +#pragma omp taskloop + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_white_Asc0) depend(out : circle_white_Asc1) + { +#pragma omp taskloop + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_white_Asc1) depend(out : circle_white_Asc2) + { +#pragma omp taskloop + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_white_Asc2) + { +#pragma omp taskloop + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------------- */ + /* ------ RADIAL BLACK SECTION ------ */ + /* ---------------------------------- */ + +#pragma omp task depend(in : first_black_circle_smoother) depend(out : radial_black_Asc0) + { +#pragma omp taskloop + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_black_Asc0) depend(out : radial_black_Asc1) + { +#pragma omp taskloop + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_black_Asc1) depend(out : radial_black_Asc2) + { +#pragma omp taskloop + for (int radial_task = 3; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_black_Asc2) depend(out : black_radial_smoother) + { +#pragma omp taskloop + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + + /* ---------------------------------- */ + /* ------ RADIAL White SECTION ------ */ + /* ---------------------------------- */ + +#pragma omp task depend(in : black_radial_smoother) depend(out : radial_white_Asc0) + { +#pragma omp taskloop + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_white_Asc0) depend(out : radial_white_Asc1) + { +#pragma omp taskloop + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_white_Asc1) depend(out : radial_white_Asc2) + { +#pragma omp taskloop + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_white_Asc2) + { +#pragma omp taskloop + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + } + } + } +} + +/* -------------------------------------------- */ +/* Parallelization Version 3: Task Dependencies */ +/* -------------------------------------------- */ + +void ExtrapolatedSmootherGive::extrapolatedSmoothingTaskDependencies(Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + omp_set_num_threads(num_omp_threads_); + + if (omp_get_max_threads() == 1) { + extrapolatedSmoothingSequential(x, rhs, temp); + } + else { + +#pragma omp parallel + { +#pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } +#pragma omp for + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int index = grid_.index(i_r, i_theta); + temp[index] = (i_r & 1 || i_theta & 1) ? rhs[index] : x[index]; + } + } + } + + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int num_radial_tasks = grid_.ntheta(); + + const int additional_radial_tasks = num_radial_tasks % 3; + + assert(num_circle_tasks >= 2); + assert(num_radial_tasks >= 3 && num_radial_tasks % 2 == 0); + + /* Make sure to deallocate at the end */ + const int shift = 3; // Additional space to ensure safe access + int* asc_ortho_circle_dep = new int[num_circle_tasks + 2 * shift]; // -1 is an additional asc_artho task! + int* smoother_circle_dep = new int[num_circle_tasks + 2 * shift]; + + int* asc_ortho_radial_dep = new int[num_radial_tasks]; + int* smoother_radial_dep = new int[num_radial_tasks]; + +#pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + +#pragma omp single + { + /* ---------------------------- */ + /* ------ CIRCLE SECTION ------ */ + + /* ---------------------------- */ + /* Asc ortho Black Circle Tasks */ + /* ---------------------------- */ + + /* Inside Black Section */ + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 1)*/ + for (int circle_task = -1; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 2)*/ + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 2 + shift], asc_ortho_circle_dep[circle_task + 2 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + + /* Black Circle Smoother */ + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : smoother_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* ---------------------------- */ + + /* Inside White Section */ + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : smoother_circle_dep[circle_task - 1 + shift], smoother_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 1)*/ + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 2)*/ + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 2 + shift], asc_ortho_circle_dep[circle_task + 2 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + + /* White Circle Smoother */ + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : smoother_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------- */ + /* ------ RADIAL SECTION ------ */ + + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* ---------------------------- */ + + /* Inside Black Section */ + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) depend(in : smoother_circle_dep[0 + shift]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 1) */ + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 2) */ + for (int radial_task = 3; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 2 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 2 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + + /* Black Radial Smoother */ + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : smoother_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 0 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* ---------------------------- */ + + /* Inside White Section */ + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : smoother_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + smoother_radial_dep[(radial_task + 0 + num_radial_tasks) % num_radial_tasks], \ + smoother_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 1) */ + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 2) */ + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 2 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 2 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + + /* White Radial Smoother */ + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : smoother_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 0 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + } + } + delete[] asc_ortho_circle_dep; + delete[] asc_ortho_radial_dep; + delete[] smoother_circle_dep; + delete[] smoother_radial_dep; + } +} diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildAscMatrices.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildAscMatrices.cpp new file mode 100644 index 00000000..46a44cbf --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/buildAscMatrices.cpp @@ -0,0 +1,776 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +/* Tridiagonal matrices */ +#define UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value) \ + do { \ + if (row == column) \ + matrix.main_diagonal(row) = value; \ + else if (row == column - 1) \ + matrix.sub_diagonal(row) = value; \ + else if (row == 0 && column == matrix.columns() - 1) \ + matrix.cyclic_corner_element() = value; \ + } while (0) + +/* Diagonal matrices */ +#define UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value) \ + do { \ + matrix.diagonal(row) = value; \ + } while (0) + +/* Inner Boundary COO/CSR matrix */ +#ifdef GMGPOLAR_USE_MUMPS + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_index(ptr + offset) = row; \ + matrix.col_index(ptr + offset) = col; \ + matrix.value(ptr + offset) = val; \ + } while (0) +#else + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_nz_index(row, offset) = col; \ + matrix.row_nz_entry(row, offset) = val; \ + } while (0) +#endif + +#define NODE_BUILD_SMOOTHER_TAKE(i_r, i_theta, grid, DirBC_Interior, inner_boundary_circle_matrix, \ + circle_diagonal_solver, circle_tridiagonal_solver, radial_diagonal_solver, \ + radial_tridiagonal_solver) \ + do { \ + assert(i_r >= 0 && i_r < grid.nr()); \ + assert(i_theta >= 0 && i_theta < grid.ntheta()); \ + \ + const int numberSmootherCircles = grid.numberSmootherCircles(); \ + const int lengthSmootherRadial = grid.lengthSmootherRadial(); \ + \ + assert(numberSmootherCircles >= 3); \ + assert(lengthSmootherRadial >= 3); \ + \ + int ptr, offset; \ + int row, column, col; \ + double value, val; \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Circle Section */ \ + /* ------------------------------------------ */ \ + if (i_r > 0 && i_r < numberSmootherCircles) { /* i_r = numberSmootherCircles-1 is included here! */ \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + int center_index = i_theta; \ + int bottom_index = i_theta_M1; \ + int top_index = i_theta_P1; \ + /* -------------------------- */ \ + /* Cyclic Tridiagonal Section */ \ + /* i_r % 2 == 1 */ \ + if (i_r & 1) { \ + /* i_theta % 2 == 1 */ \ + /* | X | O | X | */ \ + /* | | | | */ \ + /* | 0 | Õ | O | */ \ + /* | | | | */ \ + /* | X | O | X | */ \ + /* or */ \ + /* i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | X | Õ | X | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + auto& matrix = circle_tridiagonal_solver[i_r / 2]; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + /* Bottom */ \ + row = center_index; \ + column = bottom_index; \ + value = -coeff3 * (att[center] + att[bottom]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + /* Top */ \ + row = center_index; \ + column = top_index; \ + value = -coeff4 * (att[center] + att[top]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + /* ---------------- */ \ + /* Diagonal Section */ \ + /* i_r % 2 == 0 */ \ + else { \ + /* i_theta % 2 == 1 */ \ + /* | O | X | O | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | O | X | O | */ \ + /* or */ \ + /* i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | O | X̃ | O | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + \ + auto& matrix = circle_diagonal_solver[i_r / 2]; \ + \ + if (i_theta & 1) { /* i_theta % 2 == 1 */ \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + else { /* i_theta % 2 == 0 */ \ + /* Center: Coarse */ \ + auto& matrix = circle_diagonal_solver[i_r / 2]; \ + int center_index = i_theta; \ + \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + } \ + } \ + /* ------------------------------------------ */ \ + /* Circle Section: Node in the inner boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + auto& matrix = inner_boundary_circle_matrix; \ + const int center_index = i_theta; \ + const int center_nz_index = getCircleAscIndex(i_r, i_theta); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r, i_theta); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + (grid.ntheta() / 2)); \ + \ + const int center_index = i_theta; \ + const int left_index = i_theta_AcrossOrigin; \ + const int right_index = i_theta; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + const int center_nz_index = getCircleAscIndex(i_r, i_theta); \ + const int bottom_nz_index = getCircleAscIndex(i_r, i_theta_M1); \ + const int top_nz_index = getCircleAscIndex(i_r, i_theta_P1); \ + const int left_nz_index = getCircleAscIndex(i_r, i_theta_AcrossOrigin); \ + \ + auto& matrix = inner_boundary_circle_matrix; \ + \ + int nz_index; \ + const Stencil& CenterStencil = getStencil(i_r, i_theta); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -| X | O | X | */ \ + /* -| | | | */ \ + /* -| Õ | O | O | */ \ + /* -| | | | */ \ + /* -| X | O | X | */ \ + \ + const int left = grid.index(i_r, i_theta_AcrossOrigin); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + const double center_value = \ + 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + const double left_value = -coeff1 * (arr[center] + arr[left]); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r, i_theta); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* -| O | O | O | */ \ + /* -| | | | */ \ + /* -| X̃ | O | X | */ \ + /* -| | | | */ \ + /* -| O | O | O | */ \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r, i_theta); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + } \ + } \ + } \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Radial Section */ \ + /* ------------------------------------------ */ \ + else if (i_r > numberSmootherCircles && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + /* ------------------- */ \ + /* Tridiagonal Section */ \ + /* i_theta % 2 == 1 */ \ + if (i_theta & 1) { \ + /* i_r % 2 == 1 */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* or */ \ + /* i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + /* Left */ \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * (arr[center] + arr[left]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + /* Right */ \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * (arr[center] + arr[right]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + /* ---------------- */ \ + /* Diagonal Section */ \ + /* i_theta % 2 == 0 */ \ + else { \ + /* i_r % 2 == 1 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* X Õ X */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* or */ \ + /* i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* O X̃ O */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + \ + auto& matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + if (i_r & 1) { /* i_r % 2 == 1 */ \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + else { /* i_r % 2 == 0 */ \ + /* Center: Coarse */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + } \ + } \ + /* --------------------------------------------- */ \ + /* Radial Section: Node next to circular section */ \ + /* --------------------------------------------- */ \ + else if (i_r == numberSmootherCircles) { \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* | X | O | X || O X O X */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || O X O X */ \ + /* or */ \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + /* Right */ \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * (arr[center] + arr[right]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + else { \ + \ + auto& matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || Õ X O X */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X̃ O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + /* Center: Coarse */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + } \ + } \ + /* ------------------------------------------- */ \ + /* Radial Section: Node next to outer boundary */ \ + /* ------------------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + assert(i_r % 2 == 1); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + /* O O Õ O || */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + /* Left */ \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * (arr[center] + arr[left]); \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + /* Right */ \ + row = center_index; \ + column = right_index; \ + value = 0.0; /* Make tridiagonal matrix symmetric */ \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + /* O X Õ X || */ \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + \ + auto& matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + } \ + /* ------------------------------------------ */ \ + /* Radial Section: Node on the outer boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + assert(!i_r % 2 == 0); \ + \ + int center_index = i_r - numberSmootherCircles; \ + int left_index = i_r - numberSmootherCircles - 1; \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + /* O O Õ || */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + \ + row = center_index; \ + column = left_index; \ + value = 0.0; /* Make tridiagonal matrix symmetric */ \ + UPDATE_TRIDIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + /* X O X̃ || */ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + \ + auto& matrix = radial_diagonal_solver[i_theta / 2]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_DIAGONAL_ELEMENT(matrix, row, column, value); \ + } \ + } \ + } while (0) + +void ExtrapolatedSmootherTake::buildAscCircleSection(const int i_r) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + // Build Asc at the current node + NODE_BUILD_SMOOTHER_TAKE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_diagonal_solver_, circle_tridiagonal_solver_, radial_diagonal_solver_, + radial_tridiagonal_solver_); + } +} + +void ExtrapolatedSmootherTake::buildAscRadialSection(const int i_theta) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + // Build Asc at the current node + NODE_BUILD_SMOOTHER_TAKE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_diagonal_solver_, circle_tridiagonal_solver_, radial_diagonal_solver_, + radial_tridiagonal_solver_); + } +} + +/* clang-format off */ +void ExtrapolatedSmootherTake::buildAscMatrices() +{ + omp_set_num_threads(num_omp_threads_); + + /* -------------------------------------- */ + /* Part 1: Allocate Asc Smoother matrices */ + /* -------------------------------------- */ + + const int number_smoother_circles = grid_.numberSmootherCircles(); + const int length_smoother_radial = grid_.lengthSmootherRadial(); + + const int num_circle_nodes = grid_.ntheta(); + circle_tridiagonal_solver_.resize(number_smoother_circles / 2); + circle_diagonal_solver_.resize(number_smoother_circles - number_smoother_circles / 2); + + assert((grid_.ntheta() / 2) % 2 == 0); + const int num_radial_nodes = length_smoother_radial; + radial_tridiagonal_solver_.resize(grid_.ntheta() / 2); + radial_diagonal_solver_.resize(grid_.ntheta() / 2); + + // Remark: circle_diagonal_solver_[0] is undefnied. + // Use inner_boundary_circle_matrix_ instead. + #pragma omp parallel if (grid_.numberOfNodes() > 10'000) + { + // ---------------- // + // Circular Section // + #pragma omp for nowait + for (int circle_Asc_index = 0; circle_Asc_index < number_smoother_circles; circle_Asc_index++) { + + /* Inner boundary circle */ + if (circle_Asc_index == 0) { + #ifdef GMGPOLAR_USE_MUMPS + // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. + const int nnz = getNonZeroCountCircleAsc(circle_Asc_index); + inner_boundary_circle_matrix_ = SparseMatrixCOO(num_circle_nodes, num_circle_nodes, nnz); + inner_boundary_circle_matrix_.is_symmetric(false); + #else + std::function nnz_per_row = [&](int i_theta) { + if(DirBC_Interior_) return 1; + else return i_theta % 2 == 0 ? 1 : 2; + }; + inner_boundary_circle_matrix_ = SparseMatrixCSR(num_circle_nodes, num_circle_nodes, nnz_per_row); + #endif + } + + /* Interior Circle Section */ + else { + if (circle_Asc_index & 1) { + const int circle_tridiagonal_solver_index = circle_Asc_index / 2; + auto& solver_matrix = circle_tridiagonal_solver_[circle_tridiagonal_solver_index]; + solver_matrix = SymmetricTridiagonalSolver(num_circle_nodes); + solver_matrix.is_cyclic(true); + } + else { + const int circle_diagonal_solver_index = circle_Asc_index / 2; + auto& solver_matrix = circle_diagonal_solver_[circle_diagonal_solver_index]; + solver_matrix = DiagonalSolver(num_circle_nodes); + } + } + } + + // -------------- // + // Radial Section // + #pragma omp for nowait + for (int radial_Asc_index = 0; radial_Asc_index < grid_.ntheta(); radial_Asc_index++) { + if (radial_Asc_index & 1) { + const int radial_tridiagonal_solver_index = radial_Asc_index / 2; + auto& solver_matrix = radial_tridiagonal_solver_[radial_tridiagonal_solver_index]; + solver_matrix = SymmetricTridiagonalSolver(num_radial_nodes); + solver_matrix.is_cyclic(false); + } + else { + const int radial_diagonal_solver_index = radial_Asc_index / 2; + auto& solver_matrix = radial_diagonal_solver_[radial_diagonal_solver_index]; + solver_matrix = DiagonalSolver(num_radial_nodes); + } + } + } + + /* ---------------------------------- */ + /* Part 2: Fill Asc Smoother matrices */ + /* ---------------------------------- */ + + #pragma omp parallel + { + #pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildAscCircleSection(i_r); + } + + #pragma omp for nowait + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildAscRadialSection(i_theta); + } + } + + #ifdef GMGPOLAR_USE_MUMPS + /* ------------------------------------------------------------------- */ + /* Part 3: Convert inner_boundary_circle_matrix_ to a symmetric matrix */ + /* ------------------------------------------------------------------- */ + + SparseMatrixCOO full_matrix = std::move(inner_boundary_circle_matrix_); + + const int nnz = full_matrix.non_zero_size(); + const int numRows = full_matrix.rows(); + const int numColumns = full_matrix.columns(); + const int symmetric_nnz = nnz - (nnz - numRows) / 2; + + inner_boundary_circle_matrix_ = SparseMatrixCOO(numRows, numColumns, symmetric_nnz); + inner_boundary_circle_matrix_.is_symmetric(true); + + int current_nz = 0; + for (int nz_index = 0; nz_index < full_matrix.non_zero_size(); nz_index++) { + int current_row = full_matrix.row_index(nz_index); + int current_col = full_matrix.col_index(nz_index); + if (current_row <= current_col) { + inner_boundary_circle_matrix_.row_index(current_nz) = current_row; + inner_boundary_circle_matrix_.col_index(current_nz) = current_col; + inner_boundary_circle_matrix_.value(current_nz) = std::move(full_matrix.value(nz_index)); + current_nz++; + } + } + #endif +} +/* clang-format on */ \ No newline at end of file diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.cpp new file mode 100644 index 00000000..63b50a88 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.cpp @@ -0,0 +1,23 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +ExtrapolatedSmootherTake::ExtrapolatedSmootherTake(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads) + : ExtrapolatedSmoother(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, + num_omp_threads) +{ + buildAscMatrices(); +#ifdef GMGPOLAR_USE_MUMPS + initializeMumpsSolver(inner_boundary_mumps_solver_, inner_boundary_circle_matrix_); +#else + inner_boundary_lu_solver_ = SparseLUSolver(inner_boundary_circle_matrix_); +#endif +} + +ExtrapolatedSmootherTake::~ExtrapolatedSmootherTake() +{ +#ifdef GMGPOLAR_USE_MUMPS + finalizeMumpsSolver(inner_boundary_mumps_solver_); +#endif +} diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/initializeMumps.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/initializeMumps.cpp new file mode 100644 index 00000000..69d4236d --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/initializeMumps.cpp @@ -0,0 +1,112 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + +void ExtrapolatedSmootherTake::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, + SparseMatrixCOO& solver_matrix) +{ + /* + * MUMPS (a parallel direct solver) uses 1-based indexing, + * whereas the input matrix follows 0-based indexing. + * Adjust row and column indices to match MUMPS' requirements. + */ + for (int i = 0; i < solver_matrix.non_zero_size(); i++) { + solver_matrix.row_index(i) += 1; + solver_matrix.col_index(i) += 1; + } + + mumps_solver.job = JOB_INIT; + mumps_solver.par = PAR_PARALLEL; + /* The matrix is positive definite for invertible mappings. */ + /* Therefore we use SYM_POSITIVE_DEFINITE instead of SYM_GENERAL_SYMMETRIC. */ + mumps_solver.sym = (solver_matrix.is_symmetric() ? SYM_POSITIVE_DEFINITE : SYM_UNSYMMETRIC); + mumps_solver.comm_fortran = USE_COMM_WORLD; + dmumps_c(&mumps_solver); + + mumps_solver.ICNTL(1) = 0; // Output stream for error messages. + mumps_solver.ICNTL(2) = 0; // Output stream for diagnostic printing and statistics local to each MPI process. + mumps_solver.ICNTL(3) = 0; // Output stream for global information, collected on the host + mumps_solver.ICNTL(4) = 0; // Level of printing for error, warning, and diagnostic messages. + mumps_solver.ICNTL(5) = 0; // Controls the matrix input format + mumps_solver.ICNTL(6) = 7; // Permutes the matrix to a zero-free diagonal and/or scale the matrix + mumps_solver.ICNTL(7) = + 5; // Computes a symmetric permutation (ordering) to determine the pivot order to be used for the factorization in case of sequential analysis + mumps_solver.ICNTL(8) = 77; // Describes the scaling strategy + mumps_solver.ICNTL(9) = 1; // Computes the solution using A or A^T + mumps_solver.ICNTL(10) = 0; // Applies the iterative refinement to the computed solution + mumps_solver.ICNTL(11) = 0; // Computes statistics related to an error analysis of the linear system solved + mumps_solver.ICNTL(12) = 0; // Defines an ordering strategy for symmetric matrices and is used + mumps_solver.ICNTL(13) = 0; // Controls the parallelism of the root node + mumps_solver.ICNTL(14) = // Controls the percentage increase in the estimated working space + (solver_matrix.is_symmetric() ? 5 : 20); + mumps_solver.ICNTL(15) = 0; // Exploits compression of the input matrix resulting from a block format + mumps_solver.ICNTL(16) = 0; // Controls the setting of the number of OpenMP threads + // ICNTL(17) Doesn't exist + mumps_solver.ICNTL(18) = 0; // Defines the strategy for the distributed input matrix + mumps_solver.ICNTL(19) = 0; // Computes the Schur complement matrix + mumps_solver.ICNTL(20) = 0; // Determines the format (dense, sparse, or distributed) of the right-hand sides + mumps_solver.ICNTL(21) = 0; // Determines the distribution (centralized or distributed) of the solution vectors. + mumps_solver.ICNTL(22) = 0; // Controls the in-core/out-of-core (OOC) factorization and solve. + mumps_solver.ICNTL(23) = 0; // Corresponds to the maximum size of the working memory in MegaBytes that MUMPS can + // allocate per working process + mumps_solver.ICNTL(24) = 0; // Controls the detection of “null pivot rows”. + mumps_solver.ICNTL(25) = + 0; // Allows the computation of a solution of a deficient matrix and also of a null space basis + mumps_solver.ICNTL(26) = 0; // Drives the solution phase if a Schur complement matrix has been computed + mumps_solver.ICNTL(27) = -32; // Controls the blocking size for multiple right-hand sides. + mumps_solver.ICNTL(28) = 0; // Determines whether a sequential or parallel computation of the ordering is performed + mumps_solver.ICNTL(29) = + 0; // Defines the parallel ordering tool (when ICNTL(28)=1) to be used to compute the fill-in reducing permutation. + mumps_solver.ICNTL(30) = 0; // Computes a user-specified set of entries in the inverse A^−1 of the original matrix + mumps_solver.ICNTL(31) = 0; // Indicates which factors may be discarded during the factorization. + mumps_solver.ICNTL(32) = 0; // Performs the forward elimination of the right-hand sides during the factorization + mumps_solver.ICNTL(33) = 0; // Computes the determinant of the input matrix. + mumps_solver.ICNTL(34) = 0; // Controls the conservation of the OOC files during JOB= –3 + mumps_solver.ICNTL(35) = 0; // Controls the activation of the BLR feature + mumps_solver.ICNTL(36) = 0; // Controls the choice of BLR factorization variant + mumps_solver.ICNTL(37) = 0; // Controls the BLR compression of the contribution blocks + mumps_solver.ICNTL(38) = 600; // Estimates compression rate of LU factors + mumps_solver.ICNTL(39) = 500; // Estimates compression rate of contribution blocks + // ICNTL(40-47) Don't exist + mumps_solver.ICNTL(48) = 1; // Multithreading with tree parallelism + mumps_solver.ICNTL(49) = 0; // Compact workarray id%S at the end of factorization phase + // ICNTL(50-55) Don't exist + mumps_solver.ICNTL(56) = + 0; // Detects pseudo-singularities during factorization and factorizes the root node with a rankrevealing method + // ICNTL(57) Doesn't exist + mumps_solver.ICNTL(58) = 2; // Defines options for symbolic factorization + // ICNTL(59-60) Don't exist + + mumps_solver.CNTL(1) = -1.0; // Relative threshold for numerical pivoting + mumps_solver.CNTL(2) = -1.0; // Stopping criterion for iterative refinement + mumps_solver.CNTL(3) = 0.0; // Determine null pivot rows + mumps_solver.CNTL(4) = -1.0; // Determines the threshold for static pivoting + mumps_solver.CNTL(5) = + 0.0; // Defines the fixation for null pivots and is effective only when null pivot row detection is active + // CNTL(6) Doesn't exist + mumps_solver.CNTL(7) = 0.0; // Defines the precision of the dropping parameter used during BLR compression + // CNTL(8-15) Don't exist + + mumps_solver.job = JOB_ANALYSIS_AND_FACTORIZATION; + assert(solver_matrix.rows() == solver_matrix.columns()); + mumps_solver.n = solver_matrix.rows(); + mumps_solver.nz = solver_matrix.non_zero_size(); + mumps_solver.irn = solver_matrix.row_indices_data(); + mumps_solver.jcn = solver_matrix.column_indices_data(); + mumps_solver.a = solver_matrix.values_data(); + dmumps_c(&mumps_solver); + + if (mumps_solver.sym == SYM_POSITIVE_DEFINITE && mumps_solver.INFOG(12) != 0) { + std::cout << "Warning: ExtrapolatedSmoother inner boundary matrix is not positive definite: Negative pivots in " + "the factorization phase." + << std::endl; + } +} + +void ExtrapolatedSmootherTake::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +{ + mumps_solver.job = JOB_END; + dmumps_c(&mumps_solver); +} + +#endif \ No newline at end of file diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherSolver.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherSolver.cpp new file mode 100644 index 00000000..e5f93f33 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherSolver.cpp @@ -0,0 +1,588 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +/* The current position is marked with a ~ symbol. */ +#define NODE_APPLY_ASC_ORTHO_CIRCLE_TAKE(i_r, i_theta, grid, DirBC_Interior, smoother_color, x, rhs, temp, arr, att, \ + art, detDF, coeff_beta) \ + do { \ + assert(i_r >= 0 && i_r <= grid_.numberSmootherCircles()); \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 0 && i_r < grid.numberSmootherCircles()) { \ + /* -------------------------- */ \ + /* Cyclic Tridiagonal Section */ \ + /* i_r % 2 == 1 */ \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + if (i_r & 1) { \ + /* i_r % 2 == 1 and i_theta % 2 == 1 */ \ + /* | X | O | X | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | X | O | X | */ \ + /* or */ \ + /* i_r % 2 == 1 and i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | X | Õ | X | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + temp[center] = rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + if (i_theta & 1) { \ + /* i_r % 2 == 0 and i_theta % 2 == 1 */ \ + /* | O | X | O | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | O | X | O | */ \ + /* Fill temp(i,j) */ \ + temp[center] = \ + rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + /* i_r % 2 == 0 and i_theta % 2 == 0 */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | O | X̃ | O | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + temp[center] = x[center]; \ + } \ + } \ + } \ + /* -------------------- */ \ + /* Node on the boundary */ \ + /* -------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + const int center = grid.index(i_r, i_theta); \ + if (DirBC_Interior) { \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* || X | O | X | */ \ + /* || | | | */ \ + /* || Õ | O | O | */ \ + /* || | | | */ \ + /* || X | O | X | */ \ + temp[center] = rhs[center]; \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* || O | O | O | */ \ + /* || | | | */ \ + /* || X̃ | O | X | */ \ + /* || | | | */ \ + /* || O | O | O | */ \ + temp[center] = x[center]; \ + } \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid_.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid_.wrapThetaIndex(i_theta + 1); \ + const int i_theta_Across = grid_.wrapThetaIndex(i_theta + grid_.ntheta() / 2); \ + \ + const int left = grid_.index(i_r, i_theta_Across); \ + const int bottom = grid_.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid_.index(i_r, i_theta_P1); \ + const int bottom_right = grid_.index(i_r + 1, i_theta_M1); \ + const int right = grid_.index(i_r + 1, i_theta); \ + const int top_right = grid_.index(i_r + 1, i_theta_P1); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -| X | O | X | */ \ + /* -| | | | */ \ + /* -| Õ | O | O | */ \ + /* -| | | | */ \ + /* -| X | O | X | */ \ + temp[center] = \ + rhs[center] - \ + (-coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + /* - 0.25 * (art[left] + art[bottom]) * x[bottom_left] // Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + \ + /* + 0.25 * (art[left] + art[top]) * x[top_left] // Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + /* i_theta % 2 == 0 */ \ + /* -| O | O | O | */ \ + /* -| | | | */ \ + /* -| X̃ | O | X | */ \ + /* -| | | | */ \ + /* -| O | O | O | */ \ + temp[center] = x[center]; \ + } \ + } \ + } \ + } while (0) + +#define NODE_APPLY_ASC_ORTHO_RADIAL_TAKE(i_r, i_theta, grid, DirBC_Interior, smoother_color, x, rhs, temp, arr, att, \ + art, detDF, coeff_beta) \ + do { \ + assert(i_r >= grid.numberSmootherCircles() - 1 && i_r < grid.nr()); \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > grid.numberSmootherCircles() && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* X O X */ \ + /* ---------- */ \ + /* or */ \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + /* O Õ O */ \ + /* ---------- */ \ + /* O X O */ \ + /* ---------- */ \ + temp[center] = rhs[center] - (-coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* X Õ X */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + temp[center] = \ + rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + /* O X̃ O */ \ + /* ---------- */ \ + /* O O O */ \ + /* ---------- */ \ + temp[center] = x[center]; \ + } \ + } \ + } \ + else if (i_r == grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 and i_r % 2 == 1 */ \ + /* | X | O | X || O X O X */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || O X O X */ \ + /* or */ \ + /* i_theta % 2 == 1 and i_r % 2 == 0 */ \ + /* | O | X | O || X O X O */ \ + /* | | | || -------------- */ \ + /* | 0 | O | O || Õ O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X O X O */ \ + temp[center] = rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + if (i_r & 1) { \ + /* i_theta % 2 == 0 and i_r % 2 == 1 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | X | O | X || Õ X O X */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + temp[center] = \ + rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + /* i_theta % 2 == 0 and i_r % 2 == 0 */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | X | O || X̃ O X O */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + temp[center] = x[center]; \ + } \ + } \ + } \ + else if (i_r == grid.nr() - 2) { \ + assert(i_r & 1); \ + \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + /* O O Õ O || */ \ + /* ---------------|| */ \ + /* O X O X || */ \ + /* ---------------|| */ \ + /* "Right" is part of the radial Asc smoother matrices, */ \ + /* but is shifted over to the rhs to make the radial Asc smoother matrices symmetric. */ \ + /* Note that the circle Asc smoother matrices are symmetric by default. */ \ + /* Note that rhs[right] contains the correct boundary value of u_D. */ \ + temp[center] = \ + rhs[center] - (-coeff2 * (arr[center] + arr[right]) * rhs[right] /* Right: Symmetry shift! */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else { \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + /* O X Õ X || */ \ + /* ---------------|| */ \ + /* O O O O || */ \ + /* ---------------|| */ \ + temp[center] = rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + } \ + else if (i_r == grid.nr() - 1) { \ + assert(!(i_r & 1)); \ + \ + const int center = grid.index(i_r, i_theta); \ + if (i_theta & 1) { \ + /* i_theta % 2 == 1 */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + /* O O Õ || */ \ + /* -----------|| */ \ + /* X O X || */ \ + /* -----------|| */ \ + temp[center] = rhs[center]; \ + } \ + else { \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + /* X O X̃ || */ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + temp[center] = x[center]; \ + } \ + } \ + } while (0) + +void ExtrapolatedSmootherTake::applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + NODE_APPLY_ASC_ORTHO_CIRCLE_TAKE(i_r, i_theta, grid_, DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, + art, detDF, coeff_beta); + } +} + +void ExtrapolatedSmootherTake::applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, + Vector& temp) +{ + assert(i_theta >= 0 && i_theta < grid_.ntheta()); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + NODE_APPLY_ASC_ORTHO_RADIAL_TAKE(i_r, i_theta, grid_, DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, + art, detDF, coeff_beta); + } +} + +void ExtrapolatedSmootherTake::solveCircleSection(const int i_r, Vector& x, Vector& temp, + Vector& solver_storage_1, Vector& solver_storage_2) +{ + const int start = grid_.index(i_r, 0); + const int end = start + grid_.ntheta(); + if (i_r == 0) { +#ifdef GMGPOLAR_USE_MUMPS + inner_boundary_mumps_solver_.job = JOB_COMPUTE_SOLUTION; + inner_boundary_mumps_solver_.nrhs = 1; // single rhs vector + inner_boundary_mumps_solver_.nz_rhs = grid_.ntheta(); // non-zeros in rhs + inner_boundary_mumps_solver_.rhs = temp.begin() + start; + inner_boundary_mumps_solver_.lrhs = grid_.ntheta(); // leading dimension of rhs + dmumps_c(&inner_boundary_mumps_solver_); + if (inner_boundary_mumps_solver_.info[0] != 0) { + std::cerr << "Error solving the system: " << inner_boundary_mumps_solver_.info[0] << std::endl; + } +#else + inner_boundary_lu_solver_.solveInPlace(temp.begin() + start); +#endif + } + else { + if (i_r & 1) { + circle_tridiagonal_solver_[i_r / 2].solveInPlace(temp.begin() + start, solver_storage_1.begin(), + solver_storage_2.begin()); + } + else { + circle_diagonal_solver_[i_r / 2].solveInPlace(temp.begin() + start); + } + } + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +void ExtrapolatedSmootherTake::solveRadialSection(const int i_theta, Vector& x, Vector& temp, + Vector& solver_storage) +{ + const int start = grid_.index(grid_.numberSmootherCircles(), i_theta); + const int end = start + grid_.lengthSmootherRadial(); + if (i_theta & 1) { + radial_tridiagonal_solver_[i_theta / 2].solveInPlace(temp.begin() + start, solver_storage.begin()); + } + else { + radial_diagonal_solver_[i_theta / 2].solveInPlace(temp.begin() + start); + } + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +void ExtrapolatedSmootherTake::extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + +#pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + + /* The outer most circle next to the radial section is defined to be black. */ + /* Priority: Black -> White. */ + const int start_black_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 1 : 0; + const int start_white_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 0 : 1; + +/* Black Circle Section */ +#pragma omp for + for (int i_r = start_black_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } /* Implicit barrier */ + +/* White Circle Section */ +#pragma omp for nowait + for (int i_r = start_white_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } +/* Black Radial Section */ +#pragma omp for + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta += 2) { + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } /* Implicit barrier */ + +/* White Radial Section*/ +#pragma omp for + for (int i_theta = 1; i_theta < grid_.ntheta(); i_theta += 2) { + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } /* Implicit barrier */ + } +} diff --git a/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.cpp b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.cpp new file mode 100644 index 00000000..42a9fda3 --- /dev/null +++ b/src/ExtrapolatedSmoother/ExtrapolatedSmootherTake/smootherStencil.cpp @@ -0,0 +1,75 @@ +#include "../../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +const Stencil& ExtrapolatedSmootherTake::getStencil(int i_r, int i_theta) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + + assert((grid_.ntheta() / 2) % 2 == 0); + + if (i_r == 0) { + if (i_theta % 2 == 0) { + return stencil_center_; + } + else { + if (!DirBC_Interior_) { + return stencil_center_left_; + } + else { + return stencil_center_; + } + } + } + + throw std::out_of_range("getStencil: Only i_r = 0 implemented."); +} + +int ExtrapolatedSmootherTake::getNonZeroCountCircleAsc(const int i_r) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + assert((grid_.ntheta() / 2) % 2 == 0); + + if (i_r == 0) { + if (!DirBC_Interior_) { + return grid_.ntheta() / 2 + 2 * (grid_.ntheta() / 2); + } + else { + return grid_.ntheta(); + } + } + + throw std::out_of_range("nnz_circle_Asc: Only i_r = 0 implemented."); +} + +int ExtrapolatedSmootherTake::getCircleAscIndex(const int i_r, const int i_theta) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + assert((grid_.ntheta() / 2) % 2 == 0); + + if (i_r == 0) { + if (!DirBC_Interior_) { + if (i_theta % 2 == 0) { + return 3 * (i_theta / 2); + } + else { + return 3 * (i_theta / 2) + 1; + } + } + else { + return i_theta; + } + } + + throw std::out_of_range("ptr_nz_index_circle_Asc: Only i_r = 0 implemented."); +} + +int ExtrapolatedSmootherTake::getNonZeroCountRadialAsc(const int i_theta) const +{ + throw std::out_of_range("ExtrapolatedSmoother: nnz_radial_Asc not implemented."); +} + +int ExtrapolatedSmootherTake::getRadialAscIndex(const int i_r, const int i_theta) const +{ + throw std::out_of_range("ExtrapolatedSmoother: ptr_nz_index_radial_Asc not implemented."); +} diff --git a/src/ExtrapolatedSmoother/extrapolatedSmoother.cpp b/src/ExtrapolatedSmoother/extrapolatedSmoother.cpp new file mode 100644 index 00000000..54409035 --- /dev/null +++ b/src/ExtrapolatedSmoother/extrapolatedSmoother.cpp @@ -0,0 +1,14 @@ +#include "../../include/ExtrapolatedSmoother/extrapolatedSmoother.h" + +ExtrapolatedSmoother::ExtrapolatedSmoother(const PolarGrid& grid, const LevelCache& level_cache, + const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads) + : grid_(grid) + , level_cache_(level_cache) + , domain_geometry_(domain_geometry) + , density_profile_coefficients_(density_profile_coefficients) + , DirBC_Interior_(DirBC_Interior) + , num_omp_threads_(num_omp_threads) +{ +} diff --git a/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_F_Cycle.cpp b/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_F_Cycle.cpp new file mode 100644 index 00000000..e16af126 --- /dev/null +++ b/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_F_Cycle.cpp @@ -0,0 +1,119 @@ +#include "../../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::implicitlyExtrapolatedMultigrid_F_Cycle(const int level_depth, Vector& solution, + Vector& rhs, Vector& residual) +{ + assert(0 <= level_depth && level_depth < number_of_levels_ - 1); + + auto start_MGC = std::chrono::high_resolution_clock::now(); + + Level& level = levels_[level_depth]; + Level& next_level = levels_[level_depth + 1]; + + auto start_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------ */ + /* Presmoothing */ + for (int i = 0; i < pre_smoothing_steps_; i++) { + if (level_depth == 0 && !full_grid_smoothing_) { + level.extrapolatedSmoothing(solution, rhs, residual); + } + else { + level.smoothing(solution, rhs, residual); + } + } + + auto end_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_preSmoothing += std::chrono::duration(end_MGC_preSmoothing - start_MGC_preSmoothing).count(); + + /* ---------------------- */ + /* Coarse grid correction */ + /* ---------------------- */ + + /* -------------------------- */ + /* Solve A * error = residual */ + if (level_depth + 1 == number_of_levels_ - 1) { + /* --------------------- */ + /* Using a direct solver */ + /* --------------------- */ + + /* Step 1: Compute extrapolated residual */ + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + // P_ex^T (f_l - A_l*u_l) + level.computeResidual(residual, rhs, solution); + extrapolatedRestriction(level_depth, next_level.residual(), residual); + + // f_{l-1} - A_{l-1}* Inject(u_l) + injection(level_depth, next_level.solution(), solution); + next_level.computeResidual(next_level.error_correction(), next_level.rhs(), next_level.solution()); + + // res_ex = 4/3 * P_ex^T (f_l - A_l*u_l) - 1/3 * (f_{l-1} - A_{l-1}* Inject(u_l)) + linear_combination(next_level.residual(), 4.0 / 3.0, next_level.error_correction(), -1.0 / 3.0); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* Step 2: Solve for the error in place */ + auto start_MGC_directSolver = std::chrono::high_resolution_clock::now(); + + next_level.directSolveInPlace(next_level.residual()); + + auto end_MGC_directSolver = std::chrono::high_resolution_clock::now(); + t_avg_MGC_directSolver += std::chrono::duration(end_MGC_directSolver - start_MGC_directSolver).count(); + } + else { + /* ------------------------------------------ */ + /* By recursively calling the multigrid cycle */ + /* ------------------------------------------ */ + + /* Step 1: Compute extrapolated residual. */ + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + // P_ex^T (f_l - A_l*u_l) + level.computeResidual(residual, rhs, solution); + extrapolatedRestriction(level_depth, next_level.error_correction(), residual); + + // f_{l-1} - A_{l-1}* Inject(u_l) + injection(level_depth, next_level.solution(), solution); + next_level.computeResidual(next_level.residual(), next_level.rhs(), next_level.solution()); + + // res_ex = 4/3 * P_ex^T (f_l - A_l*u_l) - 1/3 * (f_{l-1} - A_{l-1}* Inject(u_l)) + linear_combination(next_level.error_correction(), 4.0 / 3.0, next_level.residual(), -1.0 / 3.0); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* Step 2: Set starting error to zero. */ + assign(next_level.residual(), 0.0); + + /* Step 3: Solve for the error by recursively calling the multigrid cycle. */ + multigrid_F_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + multigrid_V_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + } + + /* Interpolate the correction */ + extrapolatedProlongation(level_depth + 1, residual, next_level.residual()); + + /* Compute the corrected approximation: u = u + error */ + add(solution, residual); + + auto start_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------- */ + /* Postsmoothing */ + for (int i = 0; i < post_smoothing_steps_; i++) { + if (level_depth == 0 && !full_grid_smoothing_) { + level.extrapolatedSmoothing(solution, rhs, residual); + } + else { + level.smoothing(solution, rhs, residual); + } + } + + auto end_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_postSmoothing += std::chrono::duration(end_MGC_postSmoothing - start_MGC_postSmoothing).count(); + + auto end_MGC = std::chrono::high_resolution_clock::now(); + t_avg_MGC_total += std::chrono::duration(end_MGC - start_MGC).count(); +} \ No newline at end of file diff --git a/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_V_Cycle.cpp b/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_V_Cycle.cpp new file mode 100644 index 00000000..de6ef220 --- /dev/null +++ b/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_V_Cycle.cpp @@ -0,0 +1,118 @@ +#include "../../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::implicitlyExtrapolatedMultigrid_V_Cycle(const int level_depth, Vector& solution, + Vector& rhs, Vector& residual) +{ + assert(0 <= level_depth && level_depth < number_of_levels_ - 1); + + auto start_MGC = std::chrono::high_resolution_clock::now(); + + Level& level = levels_[level_depth]; + Level& next_level = levels_[level_depth + 1]; + + auto start_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------ */ + /* Presmoothing */ + for (int i = 0; i < pre_smoothing_steps_; i++) { + if (level_depth == 0 && !full_grid_smoothing_) { + level.extrapolatedSmoothing(solution, rhs, residual); + } + else { + level.smoothing(solution, rhs, residual); + } + } + + auto end_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_preSmoothing += std::chrono::duration(end_MGC_preSmoothing - start_MGC_preSmoothing).count(); + + /* ---------------------- */ + /* Coarse grid correction */ + /* ---------------------- */ + + /* -------------------------- */ + /* Solve A * error = residual */ + if (level_depth + 1 == number_of_levels_ - 1) { + /* --------------------- */ + /* Using a direct solver */ + /* --------------------- */ + + /* Step 1: Compute extrapolated residual */ + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + // P_ex^T (f_l - A_l*u_l) + level.computeResidual(residual, rhs, solution); + extrapolatedRestriction(level_depth, next_level.residual(), residual); + + // f_{l-1} - A_{l-1}* Inject(u_l) + injection(level_depth, next_level.solution(), solution); + next_level.computeResidual(next_level.error_correction(), next_level.rhs(), next_level.solution()); + + // res_ex = 4/3 * P_ex^T (f_l - A_l*u_l) - 1/3 * (f_{l-1} - A_{l-1}* Inject(u_l)) + linear_combination(next_level.residual(), 4.0 / 3.0, next_level.error_correction(), -1.0 / 3.0); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* Step 2: Solve for the error in place */ + auto start_MGC_directSolver = std::chrono::high_resolution_clock::now(); + + next_level.directSolveInPlace(next_level.residual()); + + auto end_MGC_directSolver = std::chrono::high_resolution_clock::now(); + t_avg_MGC_directSolver += std::chrono::duration(end_MGC_directSolver - start_MGC_directSolver).count(); + } + else { + /* ------------------------------------------ */ + /* By recursively calling the multigrid cycle */ + /* ------------------------------------------ */ + + /* Step 1: Compute extrapolated residual. */ + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + // P_ex^T (f_l - A_l*u_l) + level.computeResidual(residual, rhs, solution); + extrapolatedRestriction(level_depth, next_level.error_correction(), residual); + + // f_{l-1} - A_{l-1}* Inject(u_l) + injection(level_depth, next_level.solution(), solution); + next_level.computeResidual(next_level.residual(), next_level.rhs(), next_level.solution()); + + // res_ex = 4/3 * P_ex^T (f_l - A_l*u_l) - 1/3 * (f_{l-1} - A_{l-1}* Inject(u_l)) + linear_combination(next_level.error_correction(), 4.0 / 3.0, next_level.residual(), -1.0 / 3.0); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* Step 2: Set starting error to zero. */ + assign(next_level.residual(), 0.0); + + /* Step 3: Solve for the error by recursively calling the multigrid cycle. */ + multigrid_V_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + } + + /* Interpolate the correction */ + extrapolatedProlongation(level_depth + 1, residual, next_level.residual()); + + /* Compute the corrected approximation: u = u + error */ + add(solution, residual); + + auto start_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------- */ + /* Postsmoothing */ + for (int i = 0; i < post_smoothing_steps_; i++) { + if (level_depth == 0 && !full_grid_smoothing_) { + level.extrapolatedSmoothing(solution, rhs, residual); + } + else { + level.smoothing(solution, rhs, residual); + } + } + + auto end_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_postSmoothing += std::chrono::duration(end_MGC_postSmoothing - start_MGC_postSmoothing).count(); + + auto end_MGC = std::chrono::high_resolution_clock::now(); + t_avg_MGC_total += std::chrono::duration(end_MGC - start_MGC).count(); +} \ No newline at end of file diff --git a/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_W_Cycle.cpp b/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_W_Cycle.cpp new file mode 100644 index 00000000..dfa69ae0 --- /dev/null +++ b/src/GMGPolar/MultigridMethods/implicitly_extrapolated_multigrid_W_Cycle.cpp @@ -0,0 +1,119 @@ +#include "../../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::implicitlyExtrapolatedMultigrid_W_Cycle(const int level_depth, Vector& solution, + Vector& rhs, Vector& residual) +{ + assert(0 <= level_depth && level_depth < number_of_levels_ - 1); + + auto start_MGC = std::chrono::high_resolution_clock::now(); + + Level& level = levels_[level_depth]; + Level& next_level = levels_[level_depth + 1]; + + auto start_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------ */ + /* Presmoothing */ + for (int i = 0; i < pre_smoothing_steps_; i++) { + if (level_depth == 0 && !full_grid_smoothing_) { + level.extrapolatedSmoothing(solution, rhs, residual); + } + else { + level.smoothing(solution, rhs, residual); + } + } + + auto end_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_preSmoothing += std::chrono::duration(end_MGC_preSmoothing - start_MGC_preSmoothing).count(); + + /* ---------------------- */ + /* Coarse grid correction */ + /* ---------------------- */ + + /* -------------------------- */ + /* Solve A * error = residual */ + if (level_depth + 1 == number_of_levels_ - 1) { + /* --------------------- */ + /* Using a direct solver */ + /* --------------------- */ + + /* Step 1: Compute extrapolated residual */ + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + // P_ex^T (f_l - A_l*u_l) + level.computeResidual(residual, rhs, solution); + extrapolatedRestriction(level_depth, next_level.residual(), residual); + + // f_{l-1} - A_{l-1}* Inject(u_l) + injection(level_depth, next_level.solution(), solution); + next_level.computeResidual(next_level.error_correction(), next_level.rhs(), next_level.solution()); + + // res_ex = 4/3 * P_ex^T (f_l - A_l*u_l) - 1/3 * (f_{l-1} - A_{l-1}* Inject(u_l)) + linear_combination(next_level.residual(), 4.0 / 3.0, next_level.error_correction(), -1.0 / 3.0); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* Step 2: Solve for the error in place */ + auto start_MGC_directSolver = std::chrono::high_resolution_clock::now(); + + next_level.directSolveInPlace(next_level.residual()); + + auto end_MGC_directSolver = std::chrono::high_resolution_clock::now(); + t_avg_MGC_directSolver += std::chrono::duration(end_MGC_directSolver - start_MGC_directSolver).count(); + } + else { + /* ------------------------------------------ */ + /* By recursively calling the multigrid cycle */ + /* ------------------------------------------ */ + + /* Step 1: Compute extrapolated residual. */ + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + // P_ex^T (f_l - A_l*u_l) + level.computeResidual(residual, rhs, solution); + extrapolatedRestriction(level_depth, next_level.error_correction(), residual); + + // f_{l-1} - A_{l-1}* Inject(u_l) + injection(level_depth, next_level.solution(), solution); + next_level.computeResidual(next_level.residual(), next_level.rhs(), next_level.solution()); + + // res_ex = 4/3 * P_ex^T (f_l - A_l*u_l) - 1/3 * (f_{l-1} - A_{l-1}* Inject(u_l)) + linear_combination(next_level.error_correction(), 4.0 / 3.0, next_level.residual(), -1.0 / 3.0); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* Step 2: Set starting error to zero. */ + assign(next_level.residual(), 0.0); + + /* Step 3: Solve for the error by recursively calling the multigrid cycle. */ + multigrid_W_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + multigrid_W_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + } + + /* Interpolate the correction */ + extrapolatedProlongation(level_depth + 1, residual, next_level.residual()); + + /* Compute the corrected approximation: u = u + error */ + add(solution, residual); + + auto start_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------- */ + /* Postsmoothing */ + for (int i = 0; i < post_smoothing_steps_; i++) { + if (level_depth == 0 && !full_grid_smoothing_) { + level.extrapolatedSmoothing(solution, rhs, residual); + } + else { + level.smoothing(solution, rhs, residual); + } + } + + auto end_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_postSmoothing += std::chrono::duration(end_MGC_postSmoothing - start_MGC_postSmoothing).count(); + + auto end_MGC = std::chrono::high_resolution_clock::now(); + t_avg_MGC_total += std::chrono::duration(end_MGC - start_MGC).count(); +} \ No newline at end of file diff --git a/src/GMGPolar/MultigridMethods/multigrid_F_Cycle.cpp b/src/GMGPolar/MultigridMethods/multigrid_F_Cycle.cpp new file mode 100644 index 00000000..7cef5a11 --- /dev/null +++ b/src/GMGPolar/MultigridMethods/multigrid_F_Cycle.cpp @@ -0,0 +1,89 @@ +#include "../../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::multigrid_F_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual) +{ + assert(0 <= level_depth && level_depth < number_of_levels_ - 1); + + auto start_MGC = std::chrono::high_resolution_clock::now(); + + Level& level = levels_[level_depth]; + Level& next_level = levels_[level_depth + 1]; + + auto start_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------ */ + /* Presmoothing */ + for (int i = 0; i < pre_smoothing_steps_; i++) { + level.smoothing(solution, rhs, residual); + } + + auto end_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_preSmoothing += std::chrono::duration(end_MGC_preSmoothing - start_MGC_preSmoothing).count(); + + /* ---------------------- */ + /* Coarse grid correction */ + /* ---------------------- */ + + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + /* Compute the residual */ + level.computeResidual(residual, rhs, solution); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* -------------------------- */ + /* Solve A * error = residual */ + if (level_depth + 1 == number_of_levels_ - 1) { + /* --------------------- */ + /* Using a direct solver */ + /* --------------------- */ + + /* Step 1: Restrict the residual */ + restriction(level_depth, next_level.residual(), residual); + + /* Step 2: Solve for the error in place */ + auto start_MGC_directSolver = std::chrono::high_resolution_clock::now(); + + next_level.directSolveInPlace(next_level.residual()); + + auto end_MGC_directSolver = std::chrono::high_resolution_clock::now(); + t_avg_MGC_directSolver += std::chrono::duration(end_MGC_directSolver - start_MGC_directSolver).count(); + } + else { + /* ------------------------------------------ */ + /* By recursively calling the multigrid cycle */ + /* ------------------------------------------ */ + + /* Step 1: Restrict the residual. */ + restriction(level_depth, next_level.error_correction(), residual); + + /* Step 2: Set starting error to zero. */ + assign(next_level.residual(), 0.0); + + /* Step 3: Solve for the error by recursively calling the multigrid cycle. */ + multigrid_F_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + multigrid_V_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + } + + /* Interpolate the correction */ + prolongation(level_depth + 1, residual, next_level.residual()); + + /* Compute the corrected approximation: u = u + error */ + add(solution, residual); + + auto start_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------- */ + /* Postsmoothing */ + for (int i = 0; i < post_smoothing_steps_; i++) { + level.smoothing(solution, rhs, residual); + } + + auto end_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_postSmoothing += std::chrono::duration(end_MGC_postSmoothing - start_MGC_postSmoothing).count(); + + auto end_MGC = std::chrono::high_resolution_clock::now(); + t_avg_MGC_total += std::chrono::duration(end_MGC - start_MGC).count(); +} \ No newline at end of file diff --git a/src/GMGPolar/MultigridMethods/multigrid_V_Cycle.cpp b/src/GMGPolar/MultigridMethods/multigrid_V_Cycle.cpp new file mode 100644 index 00000000..aeb05e0b --- /dev/null +++ b/src/GMGPolar/MultigridMethods/multigrid_V_Cycle.cpp @@ -0,0 +1,88 @@ +#include "../../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::multigrid_V_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual) +{ + assert(0 <= level_depth && level_depth < number_of_levels_ - 1); + + auto start_MGC = std::chrono::high_resolution_clock::now(); + + Level& level = levels_[level_depth]; + Level& next_level = levels_[level_depth + 1]; + + auto start_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------ */ + /* Presmoothing */ + for (int i = 0; i < pre_smoothing_steps_; i++) { + level.smoothing(solution, rhs, residual); + } + + auto end_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_preSmoothing += std::chrono::duration(end_MGC_preSmoothing - start_MGC_preSmoothing).count(); + + /* ---------------------- */ + /* Coarse grid correction */ + /* ---------------------- */ + + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + /* Compute the residual */ + level.computeResidual(residual, rhs, solution); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* -------------------------- */ + /* Solve A * error = residual */ + if (level_depth + 1 == number_of_levels_ - 1) { + /* --------------------- */ + /* Using a direct solver */ + /* --------------------- */ + + /* Step 1: Restrict the residual */ + restriction(level_depth, next_level.residual(), residual); + + /* Step 2: Solve for the error in place */ + auto start_MGC_directSolver = std::chrono::high_resolution_clock::now(); + + next_level.directSolveInPlace(next_level.residual()); + + auto end_MGC_directSolver = std::chrono::high_resolution_clock::now(); + t_avg_MGC_directSolver += std::chrono::duration(end_MGC_directSolver - start_MGC_directSolver).count(); + } + else { + /* ------------------------------------------ */ + /* By recursively calling the multigrid cycle */ + /* ------------------------------------------ */ + + /* Step 1: Restrict the residual. */ + restriction(level_depth, next_level.error_correction(), residual); + + /* Step 2: Set starting error to zero. */ + assign(next_level.residual(), 0.0); + + /* Step 3: Solve for the error by recursively calling the multigrid cycle. */ + multigrid_V_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + } + + /* Interpolate the correction */ + prolongation(level_depth + 1, residual, next_level.residual()); + + /* Compute the corrected approximation: u = u + error */ + add(solution, residual); + + auto start_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------- */ + /* Postsmoothing */ + for (int i = 0; i < post_smoothing_steps_; i++) { + level.smoothing(solution, rhs, residual); + } + + auto end_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_postSmoothing += std::chrono::duration(end_MGC_postSmoothing - start_MGC_postSmoothing).count(); + + auto end_MGC = std::chrono::high_resolution_clock::now(); + t_avg_MGC_total += std::chrono::duration(end_MGC - start_MGC).count(); +} \ No newline at end of file diff --git a/src/GMGPolar/MultigridMethods/multigrid_W_Cycle.cpp b/src/GMGPolar/MultigridMethods/multigrid_W_Cycle.cpp new file mode 100644 index 00000000..cdd9b086 --- /dev/null +++ b/src/GMGPolar/MultigridMethods/multigrid_W_Cycle.cpp @@ -0,0 +1,89 @@ +#include "../../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::multigrid_W_Cycle(const int level_depth, Vector& solution, Vector& rhs, + Vector& residual) +{ + assert(0 <= level_depth && level_depth < number_of_levels_ - 1); + + auto start_MGC = std::chrono::high_resolution_clock::now(); + + Level& level = levels_[level_depth]; + Level& next_level = levels_[level_depth + 1]; + + auto start_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------ */ + /* Presmoothing */ + for (int i = 0; i < pre_smoothing_steps_; i++) { + level.smoothing(solution, rhs, residual); + } + + auto end_MGC_preSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_preSmoothing += std::chrono::duration(end_MGC_preSmoothing - start_MGC_preSmoothing).count(); + + /* ---------------------- */ + /* Coarse grid correction */ + /* ---------------------- */ + + auto start_MGC_residual = std::chrono::high_resolution_clock::now(); + + /* Compute the residual */ + level.computeResidual(residual, rhs, solution); + + auto end_MGC_residual = std::chrono::high_resolution_clock::now(); + t_avg_MGC_residual += std::chrono::duration(end_MGC_residual - start_MGC_residual).count(); + + /* -------------------------- */ + /* Solve A * error = residual */ + if (level_depth + 1 == number_of_levels_ - 1) { + /* --------------------- */ + /* Using a direct solver */ + /* --------------------- */ + + /* Step 1: Restrict the residual */ + restriction(level_depth, next_level.residual(), residual); + + /* Step 2: Solve for the error in place */ + auto start_MGC_directSolver = std::chrono::high_resolution_clock::now(); + + next_level.directSolveInPlace(next_level.residual()); + + auto end_MGC_directSolver = std::chrono::high_resolution_clock::now(); + t_avg_MGC_directSolver += std::chrono::duration(end_MGC_directSolver - start_MGC_directSolver).count(); + } + else { + /* ------------------------------------------ */ + /* By recursively calling the multigrid cycle */ + /* ------------------------------------------ */ + + /* Step 1: Restrict the residual. */ + restriction(level_depth, next_level.error_correction(), residual); + + /* Step 2: Set starting error to zero. */ + assign(next_level.residual(), 0.0); + + /* Step 3: Solve for the error by recursively calling the multigrid cycle. */ + multigrid_W_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + multigrid_W_Cycle(level_depth + 1, next_level.residual(), next_level.error_correction(), next_level.solution()); + } + + /* Interpolate the correction */ + prolongation(level_depth + 1, residual, next_level.residual()); + + /* Compute the corrected approximation: u = u + error */ + add(solution, residual); + + auto start_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + + /* ------------- */ + /* Postsmoothing */ + for (int i = 0; i < post_smoothing_steps_; i++) { + level.smoothing(solution, rhs, residual); + } + + auto end_MGC_postSmoothing = std::chrono::high_resolution_clock::now(); + t_avg_MGC_postSmoothing += std::chrono::duration(end_MGC_postSmoothing - start_MGC_postSmoothing).count(); + + auto end_MGC = std::chrono::high_resolution_clock::now(); + t_avg_MGC_total += std::chrono::duration(end_MGC - start_MGC).count(); +} \ No newline at end of file diff --git a/src/GMGPolar/build_rhs_f.cpp b/src/GMGPolar/build_rhs_f.cpp new file mode 100644 index 00000000..e5332e53 --- /dev/null +++ b/src/GMGPolar/build_rhs_f.cpp @@ -0,0 +1,206 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::build_rhs_f(const Level& level, Vector& rhs_f) +{ + const PolarGrid& grid = level.grid(); + assert(rhs_f.size() == grid.numberOfNodes()); + + const auto& sin_theta_cache = level.levelCache().sin_theta(); + const auto& cos_theta_cache = level.levelCache().cos_theta(); + +#pragma omp parallel + { +// ----------------------------------------- // +// Store rhs values (circular index section) // +// ----------------------------------------- // +#pragma omp for nowait + for (int i_r = 0; i_r < grid.numberSmootherCircles(); i_r++) { + double r = grid.radius(i_r); + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + double sin_theta = sin_theta_cache[i_theta]; + double cos_theta = cos_theta_cache[i_theta]; + + if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { + rhs_f[grid.index(i_r, i_theta)] = source_term_->rhs_f(r, theta, sin_theta, cos_theta); + } + else if (i_r == 0 && DirBC_Interior_) { + rhs_f[grid.index(i_r, i_theta)] = + boundary_conditions_->u_D_Interior(r, theta, sin_theta, cos_theta); + } + else if (i_r == grid.nr() - 1) { + rhs_f[grid.index(i_r, i_theta)] = boundary_conditions_->u_D(r, theta, sin_theta, cos_theta); + } + } + } + +// --------------------------------------- // +// Store rhs values (radial index section) // +// --------------------------------------- // +#pragma omp for + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + double sin_theta = sin_theta_cache[i_theta]; + double cos_theta = cos_theta_cache[i_theta]; + + for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { + double r = grid.radius(i_r); + if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { + rhs_f[grid.index(i_r, i_theta)] = source_term_->rhs_f(r, theta, sin_theta, cos_theta); + } + else if (i_r == 0 && DirBC_Interior_) { + rhs_f[grid.index(i_r, i_theta)] = + boundary_conditions_->u_D_Interior(r, theta, sin_theta, cos_theta); + } + else if (i_r == grid.nr() - 1) { + rhs_f[grid.index(i_r, i_theta)] = boundary_conditions_->u_D(r, theta, sin_theta, cos_theta); + } + } + } + } +} + +void GMGPolar::discretize_rhs_f(const Level& level, Vector& rhs_f) +{ + const PolarGrid& grid = level.grid(); + assert(rhs_f.size() == grid.numberOfNodes()); + + if (level.levelCache().cacheDomainGeometry()) { + /* DomainGeometry is cached */ + const auto& detDF_cache = level.levelCache().detDF(); +#pragma omp parallel + { +// ---------------------------------------------- // +// Discretize rhs values (circular index section) // +// ---------------------------------------------- // +#pragma omp for nowait + for (int i_r = 0; i_r < grid.numberSmootherCircles(); i_r++) { + double r = grid.radius(i_r); + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { + double h1 = (i_r == 0) ? 2.0 * grid.radius(0) : grid.radialSpacing(i_r - 1); + double h2 = grid.radialSpacing(i_r); + double k1 = grid.angularSpacing(i_theta - 1); + double k2 = grid.angularSpacing(i_theta); + const double detDF = detDF_cache[grid.index(i_r, i_theta)]; + rhs_f[grid.index(i_r, i_theta)] *= 0.25 * (h1 + h2) * (k1 + k2) * fabs(detDF); + } + else if (i_r == 0 && DirBC_Interior_) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + else if (i_r == grid.nr() - 1) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + } + } + +// -------------------------------------------- // +// Discretize rhs values (radial index section) // +// -------------------------------------------- // +#pragma omp for nowait + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { + double r = grid.radius(i_r); + if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { + double h1 = (i_r == 0) ? 2.0 * grid.radius(0) : grid.radialSpacing(i_r - 1); + double h2 = grid.radialSpacing(i_r); + double k1 = grid.angularSpacing(i_theta - 1); + double k2 = grid.angularSpacing(i_theta); + const double detDF = detDF_cache[grid.index(i_r, i_theta)]; + rhs_f[grid.index(i_r, i_theta)] *= 0.25 * (h1 + h2) * (k1 + k2) * fabs(detDF); + } + else if (i_r == 0 && DirBC_Interior_) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + else if (i_r == grid.nr() - 1) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + } + } + } + } + else { + /* DomainGeometry is not cached */ + const auto& sin_theta_cache = level.levelCache().sin_theta(); + const auto& cos_theta_cache = level.levelCache().cos_theta(); + +#pragma omp parallel + { +// ---------------------------------------------- // +// Discretize rhs values (circular index section) // +// ---------------------------------------------- // +#pragma omp for nowait + for (int i_r = 0; i_r < grid.numberSmootherCircles(); i_r++) { + double r = grid.radius(i_r); + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + double sin_theta = sin_theta_cache[i_theta]; + double cos_theta = cos_theta_cache[i_theta]; + + if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { + double h1 = (i_r == 0) ? 2.0 * grid.radius(0) : grid.radialSpacing(i_r - 1); + double h2 = grid.radialSpacing(i_r); + double k1 = grid.angularSpacing(i_theta - 1); + double k2 = grid.angularSpacing(i_theta); + /* Calculate the elements of the Jacobian matrix for the transformation mapping */ + /* The Jacobian matrix is: */ + /* [Jrr, Jrt] */ + /* [Jtr, Jtt] */ + double Jrr = domain_geometry_->dFx_dr(r, theta, sin_theta, cos_theta); + double Jtr = domain_geometry_->dFy_dr(r, theta, sin_theta, cos_theta); + double Jrt = domain_geometry_->dFx_dt(r, theta, sin_theta, cos_theta); + double Jtt = domain_geometry_->dFy_dt(r, theta, sin_theta, cos_theta); + /* Compute the determinant of the Jacobian matrix */ + double detDF = Jrr * Jtt - Jrt * Jtr; + rhs_f[grid.index(i_r, i_theta)] *= 0.25 * (h1 + h2) * (k1 + k2) * fabs(detDF); + } + else if (i_r == 0 && DirBC_Interior_) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + else if (i_r == grid.nr() - 1) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + } + } + +// -------------------------------------------- // +// Discretize rhs values (radial index section) // +// -------------------------------------------- // +#pragma omp for nowait + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + double sin_theta = sin_theta_cache[i_theta]; + double cos_theta = cos_theta_cache[i_theta]; + + for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { + double r = grid.radius(i_r); + if ((0 < i_r && i_r < grid.nr() - 1) || (i_r == 0 && !DirBC_Interior_)) { + double h1 = (i_r == 0) ? 2.0 * grid.radius(0) : grid.radialSpacing(i_r - 1); + double h2 = grid.radialSpacing(i_r); + double k1 = grid.angularSpacing(i_theta - 1); + double k2 = grid.angularSpacing(i_theta); + /* Calculate the elements of the Jacobian matrix for the transformation mapping */ + /* The Jacobian matrix is: */ + /* [Jrr, Jrt] */ + /* [Jtr, Jtt] */ + double Jrr = domain_geometry_->dFx_dr(r, theta, sin_theta, cos_theta); + double Jtr = domain_geometry_->dFy_dr(r, theta, sin_theta, cos_theta); + double Jrt = domain_geometry_->dFx_dt(r, theta, sin_theta, cos_theta); + double Jtt = domain_geometry_->dFy_dt(r, theta, sin_theta, cos_theta); + /* Compute the determinant of the Jacobian matrix */ + double detDF = Jrr * Jtt - Jrt * Jtr; + rhs_f[grid.index(i_r, i_theta)] *= 0.25 * (h1 + h2) * (k1 + k2) * fabs(detDF); + } + else if (i_r == 0 && DirBC_Interior_) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + else if (i_r == grid.nr() - 1) { + rhs_f[grid.index(i_r, i_theta)] *= 1.0; + } + } + } + } + } +} diff --git a/src/GMGPolar/gmgpolar.cpp b/src/GMGPolar/gmgpolar.cpp new file mode 100644 index 00000000..994888f9 --- /dev/null +++ b/src/GMGPolar/gmgpolar.cpp @@ -0,0 +1,463 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +#include + +GMGPolar::GMGPolar() + : parser_() +{ + // Initialize LIKWID markers if enabled + LIKWID_REGISTER("Setup"); + LIKWID_REGISTER("Solve"); + resetTimings(); + initializeGrid(); + initializeGeometry(); + initializeMultigrid(); + initializeGeneral(); + + setParameters(0, nullptr); +} + +GMGPolar::GMGPolar(std::unique_ptr domain_geometry, + std::unique_ptr density_profile_coefficients, + std::unique_ptr boundary_conditions, + std::unique_ptr source_term) + : + + domain_geometry_(std::move(domain_geometry)) + , density_profile_coefficients_(std::move(density_profile_coefficients)) + , boundary_conditions_(std::move(boundary_conditions)) + , source_term_(std::move(source_term)) + , parser_() +{ + LIKWID_REGISTER("Setup"); + LIKWID_REGISTER("Solve"); + resetTimings(); + initializeGrid(); + initializeGeometry(); + initializeMultigrid(); + initializeGeneral(); + + parseGrid(); /* Removed: parseGeometry(); */ + parseMultigrid(); + parseGeneral(); +} + +void GMGPolar::setParameters(int argc, char* argv[]) +{ + if (argc != 0) { + try { + parser_.parse_check(argc, argv); + } + catch (const cmdline::cmdline_error& parse_error) { + std::cerr << "Error: " << parse_error.what() << std::endl; + std::cerr << "Usage: " << parser_.usage() << std::endl; + } + } + + parseGrid(); + parseGeometry(); + parseMultigrid(); + parseGeneral(); +} + +void GMGPolar::setSolution(std::unique_ptr exact_solution) +{ + exact_solution_ = std::move(exact_solution); +} + +/* ----------------- */ +/* GMGPolar Solution */ +Vector& GMGPolar::solution() +{ + return levels_[0].solution(); +} +const Vector& GMGPolar::solution() const +{ + return levels_[0].solution(); +} + +const PolarGrid& GMGPolar::grid() const +{ + return levels_[0].grid(); +} + +/* Solve Properties */ +int GMGPolar::numberOfIterations() const +{ + return number_of_iterations_; +} +double GMGPolar::meanResidualReductionFactor() const +{ + return mean_residual_reduction_factor_; +} +// Only when exact solution provided +std::optional GMGPolar::exactErrorWeightedEuclidean() const +{ + if (exact_solution_) { + return exact_errors_.back().first; + } + return std::nullopt; +} +std::optional GMGPolar::exactErrorInfinity() const +{ + if (exact_solution_) { + return exact_errors_.back().second; + } + return std::nullopt; +} + +void GMGPolar::printTimings() const +{ + std::cout << "\n------------------" << std::endl; + std::cout << "Timing Information" << std::endl; + std::cout << "------------------" << std::endl; + std::cout << "Setup Time: " << t_setup_total - t_setup_rhs << " seconds" << std::endl; + std::cout << " Create Levels: " << t_setup_createLevels << " seconds" << std::endl; + std::cout << " Smoother: " << t_setup_smoother << " seconds" << std::endl; + std::cout << " Direct Solver: " << t_setup_directSolver << " seconds" << std::endl; + std::cout << " (Build rhs: " << t_setup_rhs << " seconds)" << std::endl; + std::cout << "\nSolve Time: " << t_solve_total << " seconds" << std::endl; + std::cout << " Initial Approximation: " << t_solve_initial_approximation << " seconds" << std::endl; + std::cout << " Multigrid Iteration: " << t_solve_multigrid_iterations << " seconds" << std::endl; + std::cout << " Check Convergence: " << t_check_convergence << " seconds" << std::endl; + std::cout << " (Check Exact Error: " << t_check_exact_error << " seconds)" << std::endl; + std::cout << "\nAverage Multigrid Iteration: " << t_avg_MGC_total << " seconds" << std::endl; + std::cout << " PreSmoothing: " << t_avg_MGC_preSmoothing << " seconds" << std::endl; + std::cout << " PostSmoothing: " << t_avg_MGC_postSmoothing << " seconds" << std::endl; + std::cout << " Residual: " << t_avg_MGC_residual << " seconds" << std::endl; + std::cout << " DirectSolve: " << t_avg_MGC_directSolver << " seconds" << std::endl; + std::cout << " Other Computations: " + << std::max(t_avg_MGC_total - t_avg_MGC_preSmoothing - t_avg_MGC_postSmoothing - t_avg_MGC_residual - + t_avg_MGC_directSolver, + 0.0) + << " seconds" << std::endl; + std::cout << "\n" << std::endl; +} + +/* --------------- */ +/* Grid Parameters */ +double GMGPolar::R0() const +{ + return R0_; +} + +void GMGPolar::R0(double R0) +{ + R0_ = R0; +} + +double GMGPolar::Rmax() const +{ + return Rmax_; +} + +void GMGPolar::Rmax(double Rmax) +{ + Rmax_ = Rmax; +} + +int GMGPolar::nr_exp() const +{ + return nr_exp_; +} + +void GMGPolar::nr_exp(int nr_exp) +{ + nr_exp_ = nr_exp; +} + +int GMGPolar::ntheta_exp() const +{ + return ntheta_exp_; +} + +void GMGPolar::ntheta_exp(int ntheta_exp) +{ + ntheta_exp_ = ntheta_exp; +} + +int GMGPolar::anisotropic_factor() const +{ + return anisotropic_factor_; +} + +void GMGPolar::anisotropic_factor(int anisotropic_factor) +{ + anisotropic_factor_ = anisotropic_factor; +} + +int GMGPolar::divideBy2() const +{ + return divideBy2_; +} + +void GMGPolar::divideBy2(int divideBy2) +{ + divideBy2_ = divideBy2; +} + +bool GMGPolar::write_grid_file() const +{ + return write_grid_file_; +} + +void GMGPolar::write_grid_file(bool write_grid_file) +{ + write_grid_file_ = write_grid_file; +} + +bool GMGPolar::load_grid_file() const +{ + return load_grid_file_; +} + +void GMGPolar::load_grid_file(bool load_grid_file) +{ + load_grid_file_ = load_grid_file; +} + +std::string GMGPolar::file_grid_radii() const +{ + return file_grid_radii_; +} + +void GMGPolar::file_grid_radii(const std::string& file_grid_radii) +{ + file_grid_radii_ = file_grid_radii; +} + +std::string GMGPolar::file_grid_angles() const +{ + return file_grid_angles_; +} + +void GMGPolar::file_grid_angles(const std::string& file_grid_angles) +{ + file_grid_angles_ = file_grid_angles; +} + +/* ------------------- */ +/* Geometry Parameters */ +bool GMGPolar::DirBC_Interior() const +{ + return DirBC_Interior_; +} + +void GMGPolar::DirBC_Interior(bool DirBC_Interior) +{ + DirBC_Interior_ = DirBC_Interior; +} + +/* -------------------- */ +/* Multigrid Parameters */ + +bool GMGPolar::FMG() const +{ + return FMG_; +} + +void GMGPolar::FMG(bool FMG) +{ + FMG_ = FMG; +} + +int GMGPolar::FMG_iterations() const +{ + return FMG_iterations_; +} + +void GMGPolar::FMG_iterations(int FMG_iterations) +{ + FMG_iterations_ = FMG_iterations; +} + +MultigridCycleType GMGPolar::FMG_cycle() const +{ + return FMG_cycle_; +} + +void GMGPolar::FMG_cycle(MultigridCycleType FMG_cycle) +{ + FMG_cycle_ = FMG_cycle; +} + +ExtrapolationType GMGPolar::extrapolation() const +{ + return extrapolation_; +} + +void GMGPolar::extrapolation(ExtrapolationType extrapolation) +{ + extrapolation_ = extrapolation; +} + +int GMGPolar::maxLevels() const +{ + return max_levels_; +} + +void GMGPolar::maxLevels(int max_levels) +{ + max_levels_ = max_levels; +} + +MultigridCycleType GMGPolar::multigridCycle() const +{ + return multigrid_cycle_; +} + +void GMGPolar::multigridCycle(MultigridCycleType multigrid_cycle) +{ + multigrid_cycle_ = multigrid_cycle; +} + +int GMGPolar::preSmoothingSteps() const +{ + return pre_smoothing_steps_; +} + +void GMGPolar::preSmoothingSteps(int pre_smoothing_steps) +{ + pre_smoothing_steps_ = pre_smoothing_steps; +} + +int GMGPolar::postSmoothingSteps() const +{ + return post_smoothing_steps_; +} + +void GMGPolar::postSmoothingSteps(int post_smoothing_steps) +{ + post_smoothing_steps_ = post_smoothing_steps; +} + +int GMGPolar::maxIterations() const +{ + return max_iterations_; +} + +void GMGPolar::maxIterations(int maxIterations) +{ + max_iterations_ = maxIterations; +} + +ResidualNormType GMGPolar::residualNormType() const +{ + return residual_norm_type_; +} +void GMGPolar::residualNormType(ResidualNormType residualNormType) +{ + residual_norm_type_ = residualNormType; +} + +double GMGPolar::absoluteTolerance() const +{ + if (absolute_tolerance_.has_value()) { + return absolute_tolerance_.value(); + } + else { + return -1.0; + } +} + +void GMGPolar::absoluteTolerance(double absolute_tolerance) +{ + if (absolute_tolerance > 0) { + absolute_tolerance_ = absolute_tolerance; + } + else { + absolute_tolerance_ = std::nullopt; + } +} + +double GMGPolar::relativeTolerance() const +{ + if (relative_tolerance_.has_value()) { + return relative_tolerance_.value(); + } + else { + return -1.0; + } +} + +void GMGPolar::relativeTolerance(double relative_tolerance) +{ + if (relative_tolerance > 0) { + relative_tolerance_ = relative_tolerance; + } + else { + relative_tolerance_ = std::nullopt; + } +} + +/* ------------------ */ +/* Control Parameters */ +int GMGPolar::verbose() const +{ + return verbose_; +} + +void GMGPolar::verbose(int verbose) +{ + verbose_ = verbose; +} + +bool GMGPolar::paraview() const +{ + return paraview_; +} + +void GMGPolar::paraview(bool paraview) +{ + paraview_ = paraview; +} + +int GMGPolar::maxOpenMPThreads() const +{ + return max_omp_threads_; +} + +void GMGPolar::maxOpenMPThreads(int max_omp_threads) +{ + max_omp_threads_ = max_omp_threads; +} + +double GMGPolar::threadReductionFactor() const +{ + return thread_reduction_factor_; +} + +void GMGPolar::threadReductionFactor(double thread_reduction_factor) +{ + thread_reduction_factor_ = thread_reduction_factor; +} + +StencilDistributionMethod GMGPolar::stencilDistributionMethod() const +{ + return stencil_distribution_method_; +} + +void GMGPolar::stencilDistributionMethod(StencilDistributionMethod stencil_distribution_method) +{ + stencil_distribution_method_ = stencil_distribution_method; +} + +bool GMGPolar::cacheDensityProfileCoefficients() const +{ + return cache_density_profile_coefficients_; +} + +void GMGPolar::cacheDensityProfileCoefficients(bool cache_density_profile_coefficients) +{ + cache_density_profile_coefficients_ = cache_density_profile_coefficients; +} + +bool GMGPolar::cacheDomainGeometry() const +{ + return cache_domain_geometry_; +} + +void GMGPolar::cacheDomainGeometry(bool cache_domain_geometry) +{ + cache_domain_geometry_ = cache_domain_geometry; +} \ No newline at end of file diff --git a/src/GMGPolar/level_interpolation.cpp b/src/GMGPolar/level_interpolation.cpp new file mode 100644 index 00000000..47a49efc --- /dev/null +++ b/src/GMGPolar/level_interpolation.cpp @@ -0,0 +1,55 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::prolongation(const int current_level, Vector& result, const Vector& x) const +{ + assert(current_level < number_of_levels_ && 1 <= current_level); + if (!interpolation_) + throw std::runtime_error("Interpolation not initialized."); + + interpolation_->applyProlongation(levels_[current_level], levels_[current_level - 1], result, x); +} + +void GMGPolar::restriction(const int current_level, Vector& result, const Vector& x) const +{ + assert(current_level < number_of_levels_ - 1 && 0 <= current_level); + if (!interpolation_) + throw std::runtime_error("Interpolation not initialized."); + + interpolation_->applyRestriction(levels_[current_level], levels_[current_level + 1], result, x); +} + +void GMGPolar::injection(const int current_level, Vector& result, const Vector& x) const +{ + assert(current_level < number_of_levels_ - 1 && 0 <= current_level); + if (!interpolation_) + throw std::runtime_error("Interpolation not initialized."); + + interpolation_->applyInjection(levels_[current_level], levels_[current_level + 1], result, x); +} + +void GMGPolar::extrapolatedProlongation(const int current_level, Vector& result, const Vector& x) const +{ + assert(current_level < number_of_levels_ && 1 <= current_level); + if (!interpolation_) + throw std::runtime_error("Interpolation not initialized."); + + interpolation_->applyExtrapolatedProlongation(levels_[current_level], levels_[current_level - 1], result, x); +} + +void GMGPolar::extrapolatedRestriction(const int current_level, Vector& result, const Vector& x) const +{ + assert(current_level < number_of_levels_ - 1 && 0 <= current_level); + if (!interpolation_) + throw std::runtime_error("Interpolation not initialized."); + + interpolation_->applyExtrapolatedRestriction(levels_[current_level], levels_[current_level + 1], result, x); +} + +void GMGPolar::FMGInterpolation(const int current_level, Vector& result, const Vector& x) const +{ + assert(current_level < number_of_levels_ && 1 <= current_level); + if (!interpolation_) + throw std::runtime_error("Interpolation not initialized."); + + interpolation_->applyFMGInterpolation(levels_[current_level], levels_[current_level - 1], result, x); +} \ No newline at end of file diff --git a/src/GMGPolar/parser.cpp b/src/GMGPolar/parser.cpp new file mode 100644 index 00000000..b25a4c66 --- /dev/null +++ b/src/GMGPolar/parser.cpp @@ -0,0 +1,252 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +/* Specifies whether user input is required */ +enum +{ + OPTIONAL = 0, + REQUIRED = 1 +}; + +void GMGPolar::parseGrid() +{ + R0_ = parser_.get("R0"); + Rmax_ = parser_.get("Rmax"); + nr_exp_ = parser_.get("nr_exp"); + ntheta_exp_ = parser_.get("ntheta_exp"); + anisotropic_factor_ = parser_.get("anisotropic_factor"); + divideBy2_ = parser_.get("divideBy2"); + write_grid_file_ = parser_.get("write_grid_file") != 0; + load_grid_file_ = parser_.get("load_grid_file") != 0; + file_grid_radii_ = parser_.get("file_grid_radii"); + file_grid_angles_ = parser_.get("file_grid_angles"); + DirBC_Interior_ = parser_.get("DirBC_Interior") != 0; +} + +void GMGPolar::parseGeometry() +{ + const int alphaValue = parser_.get("alpha_coeff"); + if (alphaValue == static_cast(AlphaCoeff::POISSON) || + alphaValue == static_cast(AlphaCoeff::SONNENDRUCKER) || alphaValue == static_cast(AlphaCoeff::ZONI) || + alphaValue == static_cast(AlphaCoeff::ZONI_SHIFTED)) { + alpha_ = static_cast(alphaValue); + } + else { + throw std::runtime_error("Invalid alpha coefficient value.\n"); + } + + const int problemValue = parser_.get("problem"); + if (problemValue == static_cast(ProblemType::CARTESIAN_R2) || + problemValue == static_cast(ProblemType::CARTESIAN_R6) || + problemValue == static_cast(ProblemType::POLAR_R6) || + problemValue == static_cast(ProblemType::REFINED_RADIUS)) { + problem_ = static_cast(problemValue); + } + else { + throw std::runtime_error("Invalid choice for the problem.\n"); + } + + const int geometryValue = parser_.get("geometry"); + if (geometryValue == static_cast(GeometryType::CIRCULAR) || + geometryValue == static_cast(GeometryType::SHAFRANOV) || + geometryValue == static_cast(GeometryType::CZARNY) || + geometryValue == static_cast(GeometryType::CULHAM)) { + geometry_ = static_cast(geometryValue); + } + else { + throw std::runtime_error("Invalid choice for the geometry\n"); + } + + const int betaValue = parser_.get("beta_coeff"); + if (betaValue == static_cast(BetaCoeff::ZERO) || betaValue == static_cast(BetaCoeff::ALPHA_INVERSE)) { + beta_ = static_cast(betaValue); + } + else { + throw std::runtime_error("Invalid beta coefficient value.\n"); + } + + alpha_jump_ = parser_.get("alpha_jump"); + + kappa_eps_ = parser_.get("kappa_eps"); + delta_e_ = parser_.get("delta_e"); + + selectTestCase(); +} + +void GMGPolar::parseMultigrid() +{ + FMG_ = parser_.get("FMG") != 0; + FMG_iterations_ = parser_.get("FMG_iterations"); + const int FMG_cycleValue = parser_.get("FMG_cycle"); + if (FMG_cycleValue == static_cast(MultigridCycleType::V_CYCLE) || + FMG_cycleValue == static_cast(MultigridCycleType::W_CYCLE) || + FMG_cycleValue == static_cast(MultigridCycleType::F_CYCLE)) { + FMG_cycle_ = static_cast(FMG_cycleValue); + } + else { + throw std::runtime_error("Invalid extrapolation value.\n"); + } + const int extrapolationValue = parser_.get("extrapolation"); + if (extrapolationValue == static_cast(ExtrapolationType::NONE) || + extrapolationValue == static_cast(ExtrapolationType::IMPLICIT_EXTRAPOLATION) || + extrapolationValue == static_cast(ExtrapolationType::IMPLICIT_FULL_GRID_SMOOTHING) || + extrapolationValue == static_cast(ExtrapolationType::COMBINED)) { + extrapolation_ = static_cast(extrapolationValue); + } + else { + throw std::runtime_error("Invalid extrapolation value.\n"); + } + max_levels_ = parser_.get("maxLevels"); + pre_smoothing_steps_ = parser_.get("preSmoothingSteps"); + post_smoothing_steps_ = parser_.get("postSmoothingSteps"); + + const int cycleValue = parser_.get("multigridCycle"); + if (cycleValue == static_cast(MultigridCycleType::V_CYCLE) || + cycleValue == static_cast(MultigridCycleType::W_CYCLE) || + cycleValue == static_cast(MultigridCycleType::F_CYCLE)) { + multigrid_cycle_ = static_cast(cycleValue); + } + else { + throw std::runtime_error("Invalid multigrid cycle value.\n"); + } + + max_iterations_ = parser_.get("maxIterations"); + + const int normValue = parser_.get("residualNormType"); + if (normValue == static_cast(ResidualNormType::EUCLIDEAN) || + normValue == static_cast(ResidualNormType::WEIGHTED_EUCLIDEAN) || + normValue == static_cast(ResidualNormType::INFINITY_NORM)) { + residual_norm_type_ = static_cast(normValue); + } + else { + throw std::runtime_error("Invalid residual norm type.\n"); + } + + double absTol = parser_.get("absoluteTolerance"); + if (absTol < 0) { + absolute_tolerance_ = std::nullopt; + } + else { + absolute_tolerance_ = absTol; + } + double relTol = parser_.get("relativeTolerance"); + if (relTol < 0) { + relative_tolerance_ = std::nullopt; + } + else { + relative_tolerance_ = relTol; + } +} + +void GMGPolar::parseGeneral() +{ + verbose_ = parser_.get("verbose"); + paraview_ = parser_.get("paraview") != 0; + max_omp_threads_ = parser_.get("maxOpenMPThreads"); + omp_set_num_threads(max_omp_threads_); + thread_reduction_factor_ = parser_.get("threadReductionFactor"); + const int stencilDistributionMethodValue = parser_.get("stencilDistributionMethod"); + if (stencilDistributionMethodValue == static_cast(StencilDistributionMethod::CPU_TAKE) || + stencilDistributionMethodValue == static_cast(StencilDistributionMethod::CPU_GIVE)) { + stencil_distribution_method_ = static_cast(stencilDistributionMethodValue); + } + else { + throw std::runtime_error("Invalid stencil distribution method.\n"); + } + cache_density_profile_coefficients_ = parser_.get("cacheDensityProfileCoefficients") != 0; + cache_domain_geometry_ = parser_.get("cacheDomainGeometry") != 0; +} + +void GMGPolar::initializeGrid() +{ + parser_.add("R0", 'r', "Interior radius of the disk.", OPTIONAL, 1e-5); + parser_.add("Rmax", 'R', "Exterior radius of the disk.", OPTIONAL, 1.3); + parser_.add("nr_exp", 'n', "Number of nodes (exponents) in the radial direction.", OPTIONAL, 5); + parser_.add("ntheta_exp", '\0', "Number of nodes (exponents) in the angular direction.", OPTIONAL, -1); + parser_.add("anisotropic_factor", '\0', "Defines anisotropic discretization in the radial direction.", + OPTIONAL, 0); + parser_.add("divideBy2", '\0', "Refines the grid globally `divideBy2` times.", OPTIONAL, 0); + parser_.add("write_grid_file", '\0', "Enable writing the finest PolarGrid to a file.", OPTIONAL, 0, + cmdline::oneof(0, 1)); + parser_.add("load_grid_file", '\0', "Enable loading the finest PolarGrid from a file.", OPTIONAL, 0, + cmdline::oneof(0, 1)); + parser_.add("file_grid_radii", '\0', + "Path to the file containing radii values for grid divisions in the radial direction.", + OPTIONAL, ""); + parser_.add("file_grid_angles", '\0', + "Path to the file containing theta values for grid divisions in the angular direction.", + OPTIONAL, ""); + parser_.add( + "DirBC_Interior", '\0', + "Defines the boundary condition on the interior circle: Across-origin (0), Dirichlet boundary (1).", OPTIONAL, + 0, cmdline::oneof(0, 1)); +} + +void GMGPolar::initializeGeometry() +{ + parser_.add("geometry", '\0', + "Defines the shape of the cross-section: Circular (0), Shafranov (1), Czarny (2), Culham (3).", + OPTIONAL, 0, cmdline::oneof(0, 1, 2, 3)); + parser_.add("alpha_jump", '\0', "Defines the radius of rapid decay of the density profile alpha.", OPTIONAL, + 0.0); + parser_.add("kappa_eps", 'k', "Defines the elongation of the geometry.", OPTIONAL, 0.0); + parser_.add("delta_e", 'd', "Defines the outward radial displacement of the center of flux.", OPTIONAL, + 0.0); + + parser_.add("problem", '\0', + "Defines the problem to solve (exact solution): CartesianR2 (0), PolarR6 (1), CartesianR6 (2), " + "RefinedRadius (3).", + OPTIONAL, 0, cmdline::oneof(0, 1, 2, 3)); + parser_.add("alpha_coeff", '\0', + "Defines the alpha coefficient: Poisson (0), Sonnendrucker (1), Zoni (2), Zoni-Shifted (3).", + OPTIONAL, 1, cmdline::oneof(0, 1, 2, 3)); + parser_.add("beta_coeff", '\0', "Defines the beta coefficient: beta=0 (0), beta=1/alpha (1).", OPTIONAL, 0, + cmdline::oneof(0, 1)); +} + +void GMGPolar::initializeMultigrid() +{ + parser_.add("FMG", '\0', "Specifies whether the initial approximation is obtained by nested iteration.", + OPTIONAL, 0, cmdline::oneof(0, 1)); + parser_.add("FMG_iterations", '\0', "Specifies the number of FMG iterations.", OPTIONAL, 2); + parser_.add("FMG_cycle", '\0', "Specifies the type of FMG Cycle: V-cycle (0), W-cycle (1), F-cycle (2).", + OPTIONAL, 0, cmdline::oneof(0, 1, 2)); + parser_.add("extrapolation", 'e', + "Specifies the type of extrapolation: No extrapolation (0), Implicit extrapolation (1), Implicit " + "extrapolation with full grid smoothing (2), Combination of both methods (3).", + OPTIONAL, 0, cmdline::oneof(0, 1, 2, 3)); + parser_.add("maxLevels", 'l', "Defines the maximum number of levels in the multigrid scheme.", OPTIONAL, -1); + parser_.add("preSmoothingSteps", '\0', "Number of pre-smoothing steps.", OPTIONAL, 1); + parser_.add("postSmoothingSteps", '\0', "Number of post-smoothing steps.", OPTIONAL, 1); + parser_.add("multigridCycle", '\0', "Type of Multigrid Cycle: V-cycle (0), W-cycle (1), F-cycle (2).", + OPTIONAL, 0, cmdline::oneof(0, 1, 2)); + + parser_.add("residualNormType", '\0', + "Type of Residual Norm: Euclidean (0), Weighted Euclidean (1), Infinity (2).", OPTIONAL, 0, + cmdline::oneof(0, 1, 2)); + parser_.add("maxIterations", '\0', "Maximum number of Multigrid iterations.", OPTIONAL, 150); + parser_.add("absoluteTolerance", '\0', "Convergence achieved when absolute tolerance is reached.", OPTIONAL, + 1e-8); + parser_.add("relativeTolerance", '\0', "Convergence achieved when relative tolerance is reached.", OPTIONAL, + 1e-8); +} + +void GMGPolar::initializeGeneral() +{ + parser_.add( + "verbose", '\0', + "Controls the verbosity of the output. Higher values produce more detailed diagnostic information.", OPTIONAL, + 1); + parser_.add("paraview", '\0', "Specifies whether to generate Paraview output files.", OPTIONAL, 0); + parser_.add("maxOpenMPThreads", '\0', "Defines the maximum number of OpenMP threads used.", OPTIONAL, 1); + parser_.add("threadReductionFactor", '\0', "Reduction factor for threads at coarser levels.", OPTIONAL, + 1.0); + parser_.add("stencilDistributionMethod", '\0', + "Specifies how to distribute the stencil: CPU_Take (0), CPU_Give (1).", OPTIONAL, 0, + cmdline::oneof(0, 1)); + parser_.add("cacheDensityProfileCoefficients", '\0', + "Specifies whether to cache the density profile coefficients or recalculate them dynamically.", + OPTIONAL, 1, cmdline::oneof(0, 1)); + parser_.add("cacheDomainGeometry", '\0', + "Specifies whether to cache the domain geometry or recalculate it dynamically.", OPTIONAL, 1, + cmdline::oneof(0, 1)); +} diff --git a/src/GMGPolar/select_test_case.cpp b/src/GMGPolar/select_test_case.cpp new file mode 100644 index 00000000..9083ea74 --- /dev/null +++ b/src/GMGPolar/select_test_case.cpp @@ -0,0 +1,741 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::selectTestCase() +{ + /* --------------- */ + /* Domain Geometry */ + switch (geometry_) { + case GeometryType::CIRCULAR: + domain_geometry_ = std::make_unique(Rmax_); + break; + + case GeometryType::SHAFRANOV: + domain_geometry_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + + case GeometryType::CZARNY: + domain_geometry_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + + case GeometryType::CULHAM: + domain_geometry_ = std::make_unique(Rmax_); + break; + + default: + throw std::runtime_error("Invalid geometry.\n"); + } + + /* ---------------------------- */ + /* Density Profile Coefficients */ + switch (alpha_) { + case AlphaCoeff::POISSON: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + case BetaCoeff::ALPHA_INVERSE: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + case BetaCoeff::ALPHA_INVERSE: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + case BetaCoeff::ALPHA_INVERSE: + density_profile_coefficients_ = std::make_unique(Rmax_, alpha_jump_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + + default: + throw std::runtime_error("Invalid alpha.\n"); + } + + /* ------------------------------------ */ + /* Exact Solution & Boundary Conditions */ + switch (problem_) { + case ProblemType::CARTESIAN_R2: + switch (geometry_) { + case GeometryType::CIRCULAR: + exact_solution_ = std::make_unique(Rmax_); + boundary_conditions_ = std::make_unique(Rmax_); + break; + case GeometryType::SHAFRANOV: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case GeometryType::CZARNY: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + case ProblemType::CARTESIAN_R6: + switch (geometry_) { + case GeometryType::CIRCULAR: + exact_solution_ = std::make_unique(Rmax_); + boundary_conditions_ = std::make_unique(Rmax_); + break; + case GeometryType::SHAFRANOV: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case GeometryType::CZARNY: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + case ProblemType::POLAR_R6: + switch (geometry_) { + case GeometryType::CIRCULAR: + exact_solution_ = std::make_unique(Rmax_); + boundary_conditions_ = std::make_unique(Rmax_); + break; + case GeometryType::SHAFRANOV: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case GeometryType::CZARNY: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case GeometryType::CULHAM: + exact_solution_ = std::make_unique(Rmax_); + boundary_conditions_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + case ProblemType::REFINED_RADIUS: + switch (geometry_) { + case GeometryType::CIRCULAR: + exact_solution_ = std::make_unique(Rmax_); + boundary_conditions_ = std::make_unique(Rmax_); + break; + case GeometryType::SHAFRANOV: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case GeometryType::CZARNY: + exact_solution_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + boundary_conditions_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case GeometryType::CULHAM: + exact_solution_ = std::make_unique(Rmax_); + boundary_conditions_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + default: + throw std::runtime_error("Invalid problem.\n"); + } + + /* ------------------- */ + /* Source Term (rhs_f) */ + switch (problem_) { + case ProblemType::CARTESIAN_R2: + + switch (geometry_) { + case GeometryType::CIRCULAR: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::SHAFRANOV: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::CZARNY: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + case ProblemType::CARTESIAN_R6: + + switch (geometry_) { + case GeometryType::CIRCULAR: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::SHAFRANOV: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::CZARNY: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + case ProblemType::POLAR_R6: + + switch (geometry_) { + case GeometryType::CIRCULAR: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::SHAFRANOV: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::CZARNY: + + switch (alpha_) { + case AlphaCoeff::POISSON: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case AlphaCoeff::SONNENDRUCKER: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ZERO: + source_term_ = std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha.\n"); + } + break; + + case GeometryType::CULHAM: + switch (alpha_) { + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta for configuration.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha for configuration.\n"); + } + break; + + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + case ProblemType::REFINED_RADIUS: + + switch (geometry_) { + case GeometryType::CIRCULAR: + + switch (alpha_) { + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta for configuration.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha for configuration.\n"); + } + break; + + case GeometryType::SHAFRANOV: + + switch (alpha_) { + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta for configuration.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha for configuration.\n"); + } + break; + + case GeometryType::CZARNY: + + switch (alpha_) { + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ALPHA_INVERSE: + source_term_ = + std::make_unique(Rmax_, kappa_eps_, delta_e_); + break; + default: + throw std::runtime_error("Invalid beta for configuration.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha for configuration.\n"); + } + break; + + case GeometryType::CULHAM: + + switch (alpha_) { + case AlphaCoeff::ZONI_SHIFTED: + switch (beta_) { + case BetaCoeff::ALPHA_INVERSE: + source_term_ = std::make_unique(Rmax_); + break; + default: + throw std::runtime_error("Invalid beta for configuration.\n"); + } + break; + default: + throw std::runtime_error("Invalid alpha for configuration.\n"); + } + break; + + default: + throw std::runtime_error("Invalid geometry for configuration.\n"); + } + break; + + default: + throw std::runtime_error("Invalid problem.\n"); + } +} diff --git a/src/GMGPolar/setup.cpp b/src/GMGPolar/setup.cpp new file mode 100644 index 00000000..239e064c --- /dev/null +++ b/src/GMGPolar/setup.cpp @@ -0,0 +1,271 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::setup() +{ + LIKWID_START("Setup"); + auto start_setup = std::chrono::high_resolution_clock::now(); + + resetTimings(); + + auto start_setup_createLevels = std::chrono::high_resolution_clock::now(); + + if (stencil_distribution_method_ == StencilDistributionMethod::CPU_TAKE) { + if (!cache_density_profile_coefficients_ || !cache_domain_geometry_) { + throw std::runtime_error("Error: Caching must be enabled for both density profile coefficients and domain " + "geometry in 'Take' implementation strategy."); + } + } + + // -------------------------------- // + // Create the finest mesh (level 0) // + // -------------------------------- // + auto finest_grid = std::make_unique(createFinestGrid()); /* Implementation below */ + if (verbose_ > 0) { + std::cout << "System of size (nr x ntheta) = (" << finest_grid->nr() << " x " << finest_grid->ntheta() << ")\n"; + std::cout << "on the coordinates (r x theta): (" << R0_ << ", " << Rmax_ << ") x (" << 0 << ", " << 2 * M_PI + << ")\n"; + } + if (paraview_) + writeToVTK("output_finest_grid", *finest_grid); + + // ---------------------------------------------------------- // + // Building PolarGrid and LevelCache for all multigrid levels // + // ---------------------------------------------------------- // + number_of_levels_ = chooseNumberOfLevels(*finest_grid); /* Implementation below */ + levels_.clear(); + levels_.reserve(number_of_levels_); + + if (verbose_ > 0) + std::cout << "Number of levels: " << number_of_levels_ << "\n"; + + int level_depth = 0; + auto finest_levelCache = + std::make_unique(*finest_grid, *density_profile_coefficients_, *domain_geometry_, + cache_density_profile_coefficients_, cache_domain_geometry_); + levels_.emplace_back(level_depth, std::move(finest_grid), std::move(finest_levelCache), extrapolation_, FMG_); + + for (level_depth = 1; level_depth < number_of_levels_; level_depth++) { + auto current_grid = std::make_unique(coarseningGrid(levels_[level_depth - 1].grid())); + auto current_levelCache = std::make_unique(levels_[level_depth - 1], *current_grid); + levels_.emplace_back(level_depth, std::move(current_grid), std::move(current_levelCache), extrapolation_, FMG_); + } + + auto end_setup_createLevels = std::chrono::high_resolution_clock::now(); + t_setup_createLevels += std::chrono::duration(end_setup_createLevels - start_setup_createLevels).count(); + + if (paraview_) + writeToVTK("output_coarsest_grid", levels_.back().grid()); + + // ----------------------------------------------------------- // + // Initializing the optimal number of threads for OpenMP tasks // + // ----------------------------------------------------------- // + threads_per_level_.resize(number_of_levels_, max_omp_threads_); + for (int level_depth = 0; level_depth < number_of_levels_; level_depth++) { + threads_per_level_[level_depth] = std::max( + 1, + std::min(max_omp_threads_, + static_cast(std::floor(max_omp_threads_ * std::pow(thread_reduction_factor_, level_depth))))); + } + + if (verbose_ > 0) + std::cout << "Maximum number of threads: " << max_omp_threads_ << "\n"; + + interpolation_ = std::make_unique(threads_per_level_, DirBC_Interior_); + + auto start_setup_rhs = std::chrono::high_resolution_clock::now(); + + // ------------------------------------- // + // Build rhs_f on Level 0 (finest Level) // + // ------------------------------------- // + LIKWID_STOP("Setup"); + build_rhs_f(levels_[0], levels_[0].rhs()); + LIKWID_START("Setup"); + + /* ---------------- */ + /* Discretize rhs_f */ + /* ---------------- */ + int initial_rhs_f_levels = FMG_ ? number_of_levels_ : (extrapolation_ == ExtrapolationType::NONE ? 1 : 2); + // Loop through the levels, injecting and discretizing rhs + for (int level_depth = 0; level_depth < initial_rhs_f_levels; ++level_depth) { + Level& current_level = levels_[level_depth]; + // Inject rhs if there is a next level + if (level_depth + 1 < initial_rhs_f_levels) { + Level& next_level = levels_[level_depth + 1]; + injection(level_depth, next_level.rhs(), current_level.rhs()); + } + // Discretize the rhs for the current level + discretize_rhs_f(current_level, current_level.rhs()); + } + + auto end_setup_rhs = std::chrono::high_resolution_clock::now(); + t_setup_rhs += std::chrono::duration(end_setup_rhs - start_setup_rhs).count(); + + // ------------------------------------------------------- + // Initializing various operators based on the level index + for (int level_depth = 0; level_depth < number_of_levels_; level_depth++) { + // ---------------------- // + // Level 0 (finest Level) // + // ---------------------- // + if (level_depth == 0) { + auto start_setup_smoother = std::chrono::high_resolution_clock::now(); + switch (extrapolation_) { + case ExtrapolationType::NONE: + full_grid_smoothing_ = true; + levels_[level_depth].initializeSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + break; + case ExtrapolationType::IMPLICIT_EXTRAPOLATION: + full_grid_smoothing_ = false; + levels_[level_depth].initializeExtrapolatedSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + break; + case ExtrapolationType::IMPLICIT_FULL_GRID_SMOOTHING: + full_grid_smoothing_ = true; + levels_[level_depth].initializeSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + break; + case ExtrapolationType::COMBINED: + full_grid_smoothing_ = true; + levels_[level_depth].initializeSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + levels_[level_depth].initializeExtrapolatedSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + break; + default: + full_grid_smoothing_ = false; + levels_[level_depth].initializeSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + levels_[level_depth].initializeExtrapolatedSmoothing(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + break; + } + auto end_setup_smoother = std::chrono::high_resolution_clock::now(); + t_setup_smoother += std::chrono::duration(end_setup_smoother - start_setup_smoother).count(); + levels_[level_depth].initializeResidual(*domain_geometry_, *density_profile_coefficients_, DirBC_Interior_, + threads_per_level_[level_depth], stencil_distribution_method_); + } + // -------------------------- // + // Level n-1 (coarsest Level) // + // -------------------------- // + else if (level_depth == number_of_levels_ - 1) { + auto start_setup_directSolver = std::chrono::high_resolution_clock::now(); + levels_[level_depth].initializeDirectSolver(*domain_geometry_, *density_profile_coefficients_, + DirBC_Interior_, threads_per_level_[level_depth], + stencil_distribution_method_); + auto end_setup_directSolver = std::chrono::high_resolution_clock::now(); + t_setup_directSolver += + std::chrono::duration(end_setup_directSolver - start_setup_directSolver).count(); + levels_[level_depth].initializeResidual(*domain_geometry_, *density_profile_coefficients_, DirBC_Interior_, + threads_per_level_[level_depth], stencil_distribution_method_); + } + // ------------------- // + // Intermediate levels // + // ------------------- // + else { + auto start_setup_smoother = std::chrono::high_resolution_clock::now(); + levels_[level_depth].initializeSmoothing(*domain_geometry_, *density_profile_coefficients_, DirBC_Interior_, + threads_per_level_[level_depth], stencil_distribution_method_); + auto end_setup_smoother = std::chrono::high_resolution_clock::now(); + t_setup_smoother += std::chrono::duration(end_setup_smoother - start_setup_smoother).count(); + levels_[level_depth].initializeResidual(*domain_geometry_, *density_profile_coefficients_, DirBC_Interior_, + threads_per_level_[level_depth], stencil_distribution_method_); + } + } + + auto end_setup = std::chrono::high_resolution_clock::now(); + t_setup_total += std::chrono::duration(end_setup - start_setup).count(); + LIKWID_STOP("Setup"); +} + +PolarGrid GMGPolar::createFinestGrid() +{ + PolarGrid finest_grid; + + if (load_grid_file_) { + assert(!file_grid_radii_.empty() && !file_grid_angles_.empty()); + finest_grid = PolarGrid(file_grid_radii_, file_grid_angles_); + } + else { + const double& refinement_radius = + density_profile_coefficients_->getAlphaJump(); /* Radius of anisotropic grid refinement */ + std::optional splitting_radius = std::nullopt; /* (Automatic) line splitting radius for the smoother */ + finest_grid = PolarGrid(R0_, Rmax_, nr_exp_, ntheta_exp_, refinement_radius, anisotropic_factor_, divideBy2_, + splitting_radius); + } + if (write_grid_file_) { + const int precision = 18; + finest_grid.writeToFile(file_grid_radii_, file_grid_angles_, precision); + } + return finest_grid; +} + +int GMGPolar::chooseNumberOfLevels(const PolarGrid& finestGrid) +{ + const int minRadialNodes = 5; + const int minAngularDivisions = 4; + + // Minimum level for Multigrid + const int multigridMinLevel = 2; + + // Calculate radial maximum level + int radialNodes = finestGrid.nr(); + int radialMaxLevel = 1; + while ((radialNodes + 1) / 2 >= minRadialNodes && (radialNodes + 1) % 2 == 0) { + radialNodes = (radialNodes + 1) / 2; + radialMaxLevel++; + } + + // Calculate angular maximum level + int angularDivisions = finestGrid.ntheta(); + int angularMaxLevel = 1; + while (angularDivisions / 2 >= minAngularDivisions && angularDivisions % 2 == 0 && + (angularDivisions / 2) % 2 == 0) { + angularDivisions = angularDivisions / 2; + angularMaxLevel++; + } + + /* Currently unused: Number of levels which guarantee linear scalability */ + const int linear_complexity_levels = std::ceil( + (2.0 * std::log(static_cast(finestGrid.numberOfNodes())) - std::log(3.0)) / (3.0 * std::log(4.0))); + + // Determine the number of levels as the minimum of radial maximum level, angular maximum level, + // and the maximum levels specified. + int levels = std::min(radialMaxLevel, angularMaxLevel); + if (max_levels_ > 0) + levels = std::min(max_levels_, levels); + + // Check if levels is less than Multigrid minimum level and throw an error + if (levels < multigridMinLevel) { + throw std::runtime_error("Number of possible levels is less than Multigrid minimum level"); + } + + return levels; +} + +void GMGPolar::resetTimings() +{ + t_setup_total = 0.0; + t_setup_createLevels = 0.0; + t_setup_rhs = 0.0; + t_setup_smoother = 0.0; + t_setup_directSolver = 0.0; + + t_solve_total = 0.0; + t_solve_initial_approximation = 0.0; + t_solve_multigrid_iterations = 0.0; + t_check_convergence = 0.0; + t_check_exact_error = 0.0; + + t_avg_MGC_total = 0.0; + t_avg_MGC_preSmoothing = 0.0; + t_avg_MGC_postSmoothing = 0.0; + t_avg_MGC_residual = 0.0; + t_avg_MGC_directSolver = 0.0; +} \ No newline at end of file diff --git a/src/GMGPolar/solver.cpp b/src/GMGPolar/solver.cpp new file mode 100644 index 00000000..134622d2 --- /dev/null +++ b/src/GMGPolar/solver.cpp @@ -0,0 +1,424 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +#include + +void GMGPolar::solve() +{ + LIKWID_START("Solve"); + auto start_solve = std::chrono::high_resolution_clock::now(); + + /* ---------------------------- */ + /* Initialize starting solution */ + /* ---------------------------- */ + + auto start_initial_approximation = std::chrono::high_resolution_clock::now(); + initializeSolution(); + auto end_initial_approximation = std::chrono::high_resolution_clock::now(); + t_solve_initial_approximation += + std::chrono::duration(end_initial_approximation - start_initial_approximation).count(); + + /* These times are included in the initial approximation and don't count towards the multigrid cyclces. */ + t_avg_MGC_total = 0.0; + t_avg_MGC_preSmoothing = 0.0; + t_avg_MGC_postSmoothing = 0.0; + t_avg_MGC_residual = 0.0; + t_avg_MGC_directSolver = 0.0; + + /* ------------ */ + /* Start Solver */ + /* ------------ */ + + int start_level_depth = 0; + Level& level = levels_[start_level_depth]; + + number_of_iterations_ = 0; + + double initial_residual_norm; + double current_residual_norm, current_relative_residual_norm; + + while (number_of_iterations_ < max_iterations_) { + + if (verbose_ > 0) { + std::cout << "\nIteration: " << number_of_iterations_ << std::endl; + } + + /* ---------------------------------------------- */ + /* Test solution against exact solution if given. */ + /* ---------------------------------------------- */ + + LIKWID_STOP("Solver"); + if (exact_solution_ != nullptr) { + auto start_check_exact_error = std::chrono::high_resolution_clock::now(); + + std::pair exact_error = computeExactError(level, level.solution(), level.residual()); + exact_errors_.push_back(exact_error); + + auto end_check_exact_error = std::chrono::high_resolution_clock::now(); + t_check_exact_error += + std::chrono::duration(end_check_exact_error - start_check_exact_error).count(); + + if (verbose_ > 0) { + std::cout << "Exact Weighted-Euclidean Error: " << exact_error.first << std::endl; + std::cout << "Exact Infinity Error: " << exact_error.second << std::endl; + } + } + LIKWID_START("Solver"); + + /* ---------------------------- */ + /* Compute convergence criteria */ + /* ---------------------------- */ + if (absolute_tolerance_.has_value() || relative_tolerance_.has_value()) { + auto start_check_convergence = std::chrono::high_resolution_clock::now(); + + level.computeResidual(level.residual(), level.rhs(), level.solution()); + + if (extrapolation_ != ExtrapolationType::NONE) { + Level& next_level = levels_[start_level_depth + 1]; + injection(start_level_depth, next_level.solution(), level.solution()); + next_level.computeResidual(next_level.residual(), next_level.rhs(), next_level.solution()); + extrapolatedResidual(start_level_depth, level.residual(), next_level.residual()); + } + + switch (residual_norm_type_) { + case ResidualNormType::EUCLIDEAN: + current_residual_norm = sqrt(l2_norm_squared(level.residual())); + break; + case ResidualNormType::WEIGHTED_EUCLIDEAN: + current_residual_norm = sqrt(l2_norm_squared(level.residual())) / sqrt(level.grid().numberOfNodes()); + break; + case ResidualNormType::INFINITY_NORM: + current_residual_norm = infinity_norm(level.residual()); + break; + default: + throw std::invalid_argument("Unknown ResidualNormType"); + } + residual_norms_.push_back(current_residual_norm); + + if (number_of_iterations_ == 0) { + initial_residual_norm = current_residual_norm; + current_relative_residual_norm = 1.0; + if (verbose_ > 0) { + std::cout << "Residual Norm: " << current_residual_norm << std::endl; + } + } + else { + current_relative_residual_norm = current_residual_norm / initial_residual_norm; + const double current_residual_reduction_factor = + residual_norms_[number_of_iterations_] / residual_norms_[number_of_iterations_ - 1]; + + if (verbose_ > 0) { + std::cout << "Residual Norm: " << current_residual_norm << std::endl; + std::cout << "Relative Residual Norm: " << current_relative_residual_norm << std::endl; + std::cout << "Residual Reduction Factor: " << current_residual_reduction_factor << std::endl; + } + + const double convergence_factor = 0.7; + if (current_residual_reduction_factor > convergence_factor && + extrapolation_ == ExtrapolationType::COMBINED && full_grid_smoothing_) { + full_grid_smoothing_ = false; + std::cout << "Switching from full grid smoothing to standard extrapolated smoothing." << std::endl; + } + } + + auto end_check_convergence = std::chrono::high_resolution_clock::now(); + t_check_convergence += + std::chrono::duration(end_check_convergence - start_check_convergence).count(); + + if (converged(current_residual_norm, current_relative_residual_norm)) + break; + } + + /* ------------------------- */ + /* Start Multigrid Iteration */ + /* ------------------------- */ + auto start_solve_multigrid_iterations = std::chrono::high_resolution_clock::now(); + + switch (multigrid_cycle_) { + case MultigridCycleType::V_CYCLE: + if (extrapolation_ == ExtrapolationType::NONE) { + multigrid_V_Cycle(start_level_depth, level.solution(), level.rhs(), level.residual()); + } + else { + implicitlyExtrapolatedMultigrid_V_Cycle(start_level_depth, level.solution(), level.rhs(), + level.residual()); + } + break; + case MultigridCycleType::W_CYCLE: + if (extrapolation_ == ExtrapolationType::NONE) { + multigrid_W_Cycle(start_level_depth, level.solution(), level.rhs(), level.residual()); + } + else { + implicitlyExtrapolatedMultigrid_W_Cycle(start_level_depth, level.solution(), level.rhs(), + level.residual()); + } + break; + case MultigridCycleType::F_CYCLE: + if (extrapolation_ == ExtrapolationType::NONE) { + multigrid_F_Cycle(start_level_depth, level.solution(), level.rhs(), level.residual()); + } + else { + implicitlyExtrapolatedMultigrid_F_Cycle(start_level_depth, level.solution(), level.rhs(), + level.residual()); + } + break; + default: + throw std::invalid_argument("Unknown MultigridCycleType"); + } + number_of_iterations_++; + + auto end_solve_multigrid_iterations = std::chrono::high_resolution_clock::now(); + t_solve_multigrid_iterations += + std::chrono::duration(end_solve_multigrid_iterations - start_solve_multigrid_iterations).count(); + } + + if (number_of_iterations_ > 0) { + /* --------------------------------------------- */ + /* Compute the average Multigrid Iteration times */ + /* --------------------------------------------- */ + t_avg_MGC_total = t_solve_multigrid_iterations / number_of_iterations_; + t_avg_MGC_preSmoothing /= number_of_iterations_; + t_avg_MGC_postSmoothing /= number_of_iterations_; + t_avg_MGC_residual /= number_of_iterations_; + t_avg_MGC_directSolver /= number_of_iterations_; + + /* -------------------------------- */ + /* Compute the reduction factor rho */ + /* -------------------------------- */ + mean_residual_reduction_factor_ = + std::pow(current_residual_norm / initial_residual_norm, 1.0 / number_of_iterations_); + + if (verbose_ > 0) { + std::cout << "\nTotal Iterations: " << number_of_iterations_ << std::endl; + std::cout << "Mean Residual Reduction Factor Rho: " << mean_residual_reduction_factor_ << std::endl; + } + } + + auto end_solve = std::chrono::high_resolution_clock::now(); + t_solve_total += std::chrono::duration(end_solve - start_solve).count(); + t_solve_total -= t_check_exact_error; + LIKWID_STOP("Solve"); + + if (paraview_) { + computeExactError(level, level.solution(), level.residual()); + writeToVTK("output_solution", level, level.solution()); + writeToVTK("output_error", level, level.residual()); + } +} + +void GMGPolar::initializeSolution() +{ + if (!FMG_) { + int start_level_depth = 0; + Level& level = levels_[start_level_depth]; + assign(level.solution(), 0.0); // Assign zero initial guess if not using FMG + + /* Consider setting the boundary conditions u_D and u_D_Interior if DirBC_Interior to the initial solution */ + bool use_boundary_condition = false; + if (use_boundary_condition) { + const auto& grid = level.grid(); + const auto& sin_theta_cache = level.levelCache().sin_theta(); + const auto& cos_theta_cache = level.levelCache().cos_theta(); + + const int i_r_inner = 0; + const int i_r_outer = grid.nr() - 1; + const double r_inner = grid.radius(i_r_inner); + const double r_outer = grid.radius(i_r_outer); + + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + const double theta = grid.theta(i_theta); + const double sin_theta = sin_theta_cache[i_theta]; + const double cos_theta = cos_theta_cache[i_theta]; + if (DirBC_Interior_) { // Apply interior Dirichlet BC if enabled. + const int index = grid.index(i_r_inner, i_theta); + level.solution()[index] = boundary_conditions_->u_D_Interior(r_inner, theta, sin_theta, cos_theta); + } + // Always apply outer boundary condition. + const int index = grid.index(i_r_outer, i_theta); + level.solution()[index] = boundary_conditions_->u_D(r_outer, theta, sin_theta, cos_theta); + } + } + } + else { + // Start from the coarsest level + int FMG_start_level_depth = number_of_levels_ - 1; + Level& FMG_level = levels_[FMG_start_level_depth]; + + // Solve directly on the coarsest level + FMG_level.solution() = FMG_level.rhs(); + FMG_level.directSolveInPlace(FMG_level.solution()); // Direct solve on coarsest grid + + // Prolongate the solution from the coarsest level up to the finest, while applying Multigrid Cycles on each level + for (int current_level = FMG_start_level_depth - 1; current_level > 0; --current_level) { + Level& FMG_level = levels_[current_level]; // The current level + Level& next_FMG_level = levels_[current_level - 1]; // The finer level + + // The bi-cubic FMG interpolation is of higher order + FMGInterpolation(current_level, next_FMG_level.solution(), FMG_level.solution()); + + // Apply some FMG iterations + for (int i = 0; i < FMG_iterations_; i++) { + if (current_level - 1 == 0 && (extrapolation_ != ExtrapolationType::NONE)) { + switch (FMG_cycle_) { + case MultigridCycleType::V_CYCLE: + implicitlyExtrapolatedMultigrid_V_Cycle(current_level - 1, next_FMG_level.solution(), + next_FMG_level.rhs(), next_FMG_level.residual()); + break; + + case MultigridCycleType::W_CYCLE: + implicitlyExtrapolatedMultigrid_W_Cycle(current_level - 1, next_FMG_level.solution(), + next_FMG_level.rhs(), next_FMG_level.residual()); + break; + + case MultigridCycleType::F_CYCLE: + implicitlyExtrapolatedMultigrid_F_Cycle(current_level - 1, next_FMG_level.solution(), + next_FMG_level.rhs(), next_FMG_level.residual()); + break; + + default: + std::cerr << "Error: Unknown multigrid cycle type!" << std::endl; + throw std::runtime_error("Invalid multigrid cycle type encountered."); + break; + } + } + else { + switch (FMG_cycle_) { + case MultigridCycleType::V_CYCLE: + multigrid_V_Cycle(current_level - 1, next_FMG_level.solution(), next_FMG_level.rhs(), + next_FMG_level.residual()); + break; + + case MultigridCycleType::W_CYCLE: + multigrid_W_Cycle(current_level - 1, next_FMG_level.solution(), next_FMG_level.rhs(), + next_FMG_level.residual()); + break; + + case MultigridCycleType::F_CYCLE: + multigrid_F_Cycle(current_level - 1, next_FMG_level.solution(), next_FMG_level.rhs(), + next_FMG_level.residual()); + break; + + default: + std::cerr << "Error: Unknown multigrid cycle type!" << std::endl; + throw std::runtime_error("Invalid multigrid cycle type encountered."); + break; + } + } + } + } + } +} + +bool GMGPolar::converged(const double& residual_norm, const double& relative_residual_norm) +{ + if (relative_tolerance_.has_value()) { + if (!(relative_residual_norm > relative_tolerance_.value())) { + return true; + } + } + if (absolute_tolerance_.has_value()) { + if (!(residual_norm > absolute_tolerance_.value())) { + return true; + } + } + return false; +} + +std::pair GMGPolar::computeExactError(Level& level, const Vector& solution, + Vector& error) +{ + assert(exact_solution_ != nullptr); + + omp_set_num_threads(threads_per_level_[level.level_depth()]); + + const PolarGrid& grid = level.grid(); + const LevelCache& levelCache = level.levelCache(); + const auto& sin_theta_cache = levelCache.sin_theta(); + const auto& cos_theta_cache = levelCache.cos_theta(); + + assert(solution.size() == error.size()); + assert(solution.size() == grid.numberOfNodes()); + +#pragma omp parallel + { +#pragma omp for nowait + for (int i_r = 0; i_r < grid.numberSmootherCircles(); i_r++) { + double r = grid.radius(i_r); + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + double sin_theta = sin_theta_cache[i_theta]; + double cos_theta = cos_theta_cache[i_theta]; + error[grid.index(i_r, i_theta)] = exact_solution_->exact_solution(r, theta, sin_theta, cos_theta) - + solution[grid.index(i_r, i_theta)]; + } + } +#pragma omp for nowait + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + double theta = grid.theta(i_theta); + double sin_theta = sin_theta_cache[i_theta]; + double cos_theta = cos_theta_cache[i_theta]; + for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { + double r = grid.radius(i_r); + error[grid.index(i_r, i_theta)] = exact_solution_->exact_solution(r, theta, sin_theta, cos_theta) - + solution[grid.index(i_r, i_theta)]; + } + } + } + + double weighted_euclidean_error = sqrt(l2_norm_squared(error)) / sqrt(grid.numberOfNodes()); + double infinity_error = infinity_norm(error); + + return std::make_pair(weighted_euclidean_error, infinity_error); +} + +void GMGPolar::extrapolatedResidual(const int current_level, Vector& residual, + const Vector& residual_next_level) +{ + omp_set_num_threads(threads_per_level_[current_level]); + + const PolarGrid& fineGrid = levels_[current_level].grid(); + const PolarGrid& coarseGrid = levels_[current_level + 1].grid(); + + assert(residual.size() == fineGrid.numberOfNodes()); + assert(residual_next_level.size() == coarseGrid.numberOfNodes()); + +#pragma omp parallel + { +/* Circluar Indexing Section */ +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r = 0; i_r < fineGrid.numberSmootherCircles(); i_r++) { + int i_r_coarse = i_r / 2; + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + + if (i_r & 1 || i_theta & 1) { + residual[fineGrid.index(i_r, i_theta)] *= 4.0 / 3.0; + } + else { + int fine_idx = fineGrid.index(i_r, i_theta); + int coarse_idx = coarseGrid.index(i_r_coarse, i_theta_coarse); + residual[fine_idx] = (4.0 * residual[fine_idx] - residual_next_level[coarse_idx]) / 3.0; + } + } + } + +/* Radial Indexing Section */ +/* For loop matches radial access pattern */ +#pragma omp for nowait + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + for (int i_r = fineGrid.numberSmootherCircles(); i_r < fineGrid.nr(); i_r++) { + int i_r_coarse = i_r / 2; + + if (i_r & 1 || i_theta & 1) { + residual[fineGrid.index(i_r, i_theta)] *= 4.0 / 3.0; + } + else { + int fine_idx = fineGrid.index(i_r, i_theta); + int coarse_idx = coarseGrid.index(i_r_coarse, i_theta_coarse); + residual[fine_idx] = (4.0 * residual[fine_idx] - residual_next_level[coarse_idx]) / 3.0; + } + } + } + } +} diff --git a/src/GMGPolar/writeToVTK.cpp b/src/GMGPolar/writeToVTK.cpp new file mode 100644 index 00000000..d110b7e9 --- /dev/null +++ b/src/GMGPolar/writeToVTK.cpp @@ -0,0 +1,145 @@ +#include "../../include/GMGPolar/gmgpolar.h" + +void GMGPolar::writeToVTK(const std::filesystem::path& file_path, const PolarGrid& grid) +{ + const auto filename = file_path.stem().string() + ".vtu"; + + std::ofstream file(file_path.parent_path() / filename); + if (!file.is_open()) { + throw std::runtime_error("Failed to open file '" + (file_path.parent_path() / filename).string() + "'"); + } + + file << "\n" + << "\n" + << "\n" + << "\n"; + + // Write points + file << "\n" + << "\n"; + int i_r, i_theta; + double r, theta; + for (int index = 0; index < grid.numberOfNodes(); index++) { + grid.multiIndex(index, i_r, i_theta); + r = grid.radius(i_r); + theta = grid.theta(i_theta); + double sin_theta = std::sin(theta); + double cos_theta = std::cos(theta); + file << domain_geometry_->Fx(r, theta, sin_theta, cos_theta) << " " + << domain_geometry_->Fy(r, theta, sin_theta, cos_theta) << " " << 0 << "\n"; + } + file << "\n" + << "\n"; + + // Write cells + file << "\n"; + file << "\n"; + for (int i_r = 0; i_r < grid.nr() - 1; i_r++) { + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + file << grid.index(i_r, i_theta) << " " << grid.index(i_r + 1, i_theta) << " " + << grid.index(i_r + 1, i_theta + 1) << " " << grid.index(i_r, i_theta + 1) << "\n"; + } + } + file << "\n"; + + file << "\n"; + for (int i = 0; i < (grid.nr() - 1) * grid.ntheta(); i++) { + file << 4 * (i + 1) << " "; + } + file << "\n"; + + file << "\n"; + for (int i = 0; i < (grid.nr() - 1) * grid.ntheta(); i++) { + file << "9 "; // VTK_QUAD + } + file << "\n"; + + file << "\n" + << "\n" + << "\n" + << "\n"; +} + +void GMGPolar::writeToVTK(const std::filesystem::path& file_path, const Level& level, + const Vector& grid_function) +{ + const PolarGrid& grid = level.grid(); + const LevelCache& level_cache = level.levelCache(); + + assert(grid.numberOfNodes() == grid_function.size()); + + const Vector& sin_theta_cache = level_cache.sin_theta(); + const Vector& cos_theta_cache = level_cache.cos_theta(); + + const auto filename = file_path.stem().string() + ".vtu"; + + std::ofstream file(file_path.parent_path() / filename); + if (!file.is_open()) + throw std::runtime_error("Failed to open file '" + (file_path.parent_path() / filename).string() + "'"); + + file << "\n" + << "\n" + << "\n" + << "\n"; + + // Write points + file << "\n" + << "\n"; + int i_r, i_theta; + double r, theta; + double sin_theta, cos_theta; + for (int index = 0; index < grid.numberOfNodes(); index++) { + grid.multiIndex(index, i_r, i_theta); + r = grid.radius(i_r); + theta = grid.theta(i_theta); + sin_theta = sin_theta_cache[i_theta]; + cos_theta = cos_theta_cache[i_theta]; + file << domain_geometry_->Fx(r, theta, sin_theta, cos_theta) << " " + << domain_geometry_->Fy(r, theta, sin_theta, cos_theta) << " " << 0 << "\n"; + } + + file << "\n" + << "\n"; + file << "\n"; + + // Connectivity + file << "\n"; + for (int i_r = 0; i_r < grid.nr() - 1; i_r++) { + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + file << grid.index(i_r, i_theta) << " " << grid.index(i_r + 1, i_theta) << " " + << grid.index(i_r + 1, i_theta + 1) << " " << grid.index(i_r, i_theta + 1) << "\n"; + } + } + + file << "\n"; + + file << "\n"; + for (int i = 0; i < (grid.nr() - 1) * grid.ntheta(); i++) { + file << 4 * (i + 1) << " "; + } + + file << "\n"; + // Cell types + file << "\n"; + for (int i = 0; i < (grid.nr() - 1) * grid.ntheta(); ++i) { + file << "9 "; // VTK_QUAD + } + + file << "\n"; + file << "\n"; + file << "\n"; + + file << ""; + + for (int i = 0; i < grid.numberOfNodes(); i++) { + file << grid_function[i] << "\n"; + } + + file << "\n" + << "\n" + << "\n" + << "\n" + << "\n"; +} diff --git a/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.cpp b/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.cpp new file mode 100644 index 00000000..fc6181a5 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.cpp @@ -0,0 +1,20 @@ +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h" + +CartesianR2_Boundary_CircularGeometry::CartesianR2_Boundary_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_Boundary_CircularGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} + +double CartesianR2_Boundary_CircularGeometry::u_D_Interior(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.cpp b/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.cpp new file mode 100644 index 00000000..f4344a36 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.cpp @@ -0,0 +1,36 @@ +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CzarnyGeometry.h" + +void CartesianR2_Boundary_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_Boundary_CzarnyGeometry::CartesianR2_Boundary_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_Boundary_CzarnyGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r / Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / (2.0 - temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon); +} + +double CartesianR2_Boundary_CzarnyGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r / Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / (2.0 - temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon); +} diff --git a/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.cpp b/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.cpp new file mode 100644 index 00000000..24c6a5fd --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.cpp @@ -0,0 +1,28 @@ +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_ShafranovGeometry.h" + +CartesianR2_Boundary_ShafranovGeometry::CartesianR2_Boundary_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_Boundary_ShafranovGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)); +} + +double CartesianR2_Boundary_ShafranovGeometry::u_D_Interior(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)); +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.cpp b/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.cpp new file mode 100644 index 00000000..e0a2710e --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.cpp @@ -0,0 +1,20 @@ +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CircularGeometry.h" + +CartesianR6_Boundary_CircularGeometry::CartesianR6_Boundary_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_Boundary_CircularGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} + +double CartesianR6_Boundary_CircularGeometry::u_D_Interior(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.cpp b/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.cpp new file mode 100644 index 00000000..894432f8 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.cpp @@ -0,0 +1,36 @@ +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_CzarnyGeometry.h" + +void CartesianR6_Boundary_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_Boundary_CzarnyGeometry::CartesianR6_Boundary_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_Boundary_CzarnyGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r / Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / (2.0 - temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon); +} + +double CartesianR6_Boundary_CzarnyGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r / Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / (2.0 - temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon); +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.cpp b/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.cpp new file mode 100644 index 00000000..36ee3023 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.cpp @@ -0,0 +1,28 @@ +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h" + +CartesianR6_Boundary_ShafranovGeometry::CartesianR6_Boundary_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_Boundary_ShafranovGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)); +} + +double CartesianR6_Boundary_ShafranovGeometry::u_D_Interior(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)); +} diff --git a/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.cpp b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.cpp new file mode 100644 index 00000000..b444b76c --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.cpp @@ -0,0 +1,18 @@ +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CircularGeometry.h" + +PolarR6_Boundary_CircularGeometry::PolarR6_Boundary_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_Boundary_CircularGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} + +double PolarR6_Boundary_CircularGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} diff --git a/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.cpp b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.cpp new file mode 100644 index 00000000..82b52193 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.cpp @@ -0,0 +1,18 @@ +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CulhamGeometry.h" + +PolarR6_Boundary_CulhamGeometry::PolarR6_Boundary_CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_Boundary_CulhamGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.0; +} + +double PolarR6_Boundary_CulhamGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.0; +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.cpp b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.cpp new file mode 100644 index 00000000..868cdb7f --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.cpp @@ -0,0 +1,28 @@ +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" + +void PolarR6_Boundary_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_Boundary_CzarnyGeometry::PolarR6_Boundary_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_Boundary_CzarnyGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} + +double PolarR6_Boundary_CzarnyGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.cpp b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.cpp new file mode 100644 index 00000000..bc04fb17 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_ShafranovGeometry.h" + +PolarR6_Boundary_ShafranovGeometry::PolarR6_Boundary_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_Boundary_ShafranovGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} + +double PolarR6_Boundary_ShafranovGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} \ No newline at end of file diff --git a/src/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.cpp b/src/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.cpp new file mode 100644 index 00000000..f4c3868e --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.cpp @@ -0,0 +1,28 @@ +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CircularGeometry.h" + +Refined_Boundary_CircularGeometry::Refined_Boundary_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double Refined_Boundary_CircularGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} + +double Refined_Boundary_CircularGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} diff --git a/src/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.cpp b/src/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.cpp new file mode 100644 index 00000000..9c647a65 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.cpp @@ -0,0 +1,18 @@ +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h" + +Refined_Boundary_CulhamGeometry::Refined_Boundary_CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double Refined_Boundary_CulhamGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.0; +} + +double Refined_Boundary_CulhamGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.0; +} diff --git a/src/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.cpp b/src/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.cpp new file mode 100644 index 00000000..3aad5771 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.cpp @@ -0,0 +1,38 @@ +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CzarnyGeometry.h" + +void Refined_Boundary_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +Refined_Boundary_CzarnyGeometry::Refined_Boundary_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double Refined_Boundary_CzarnyGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} + +double Refined_Boundary_CzarnyGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} diff --git a/src/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.cpp b/src/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.cpp new file mode 100644 index 00000000..e5acadc8 --- /dev/null +++ b/src/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.cpp @@ -0,0 +1,32 @@ +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_ShafranovGeometry.h" + +Refined_Boundary_ShafranovGeometry::Refined_Boundary_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double Refined_Boundary_ShafranovGeometry::u_D(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} + +double Refined_Boundary_ShafranovGeometry::u_D_Interior(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} diff --git a/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp new file mode 100644 index 00000000..2df75bd8 --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/poissonCoefficients.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h" + +PoissonCoefficients::PoissonCoefficients(const double& Rmax, const double& alpha_jump) + : Rmax(Rmax) + , alpha_jump(alpha_jump) +{ +} + +double PoissonCoefficients::alpha(const double& r) const +{ + return 1.0; +} + +double PoissonCoefficients::beta(const double& r) const +{ + return 0.0; +} + +double PoissonCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp new file mode 100644 index 00000000..849d77f8 --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/sonnendruckerCoefficients.h" + +SonnendruckerCoefficients::SonnendruckerCoefficients(const double& Rmax, const double& alpha_jump) + : Rmax(Rmax) + , alpha_jump(alpha_jump) +{ +} + +double SonnendruckerCoefficients::alpha(const double& r) const +{ + return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111); +} + +double SonnendruckerCoefficients::beta(const double& r) const +{ + return 0.0; +} + +double SonnendruckerCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp new file mode 100644 index 00000000..037e230c --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.cpp @@ -0,0 +1,23 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h" + +SonnendruckerGyroCoefficients::SonnendruckerGyroCoefficients(const double& _Rmax, const double& _alpha_jump) + : Rmax(_Rmax) + , alpha_jump(_alpha_jump) +{ +} + +double SonnendruckerGyroCoefficients::alpha(const double& r) const +{ + return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111); +} + +double SonnendruckerGyroCoefficients::beta(const double& r) const +{ + return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)), + (double)((-1))); +} + +double SonnendruckerGyroCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp new file mode 100644 index 00000000..5e4b9a0d --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/zoniCoefficients.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/zoniCoefficients.h" + +ZoniCoefficients::ZoniCoefficients(const double& Rmax, const double& alpha_jump) + : Rmax(Rmax) + , alpha_jump(alpha_jump) +{ +} + +double ZoniCoefficients::alpha(const double& r) const +{ + return exp(-tanh(10.0 * (r / Rmax) - 5.0)); +} + +double ZoniCoefficients::beta(const double& r) const +{ + return 0.0; +} + +double ZoniCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp new file mode 100644 index 00000000..0e339325 --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h" + +ZoniGyroCoefficients::ZoniGyroCoefficients(const double& Rmax, const double& alpha_jump) + : Rmax(Rmax) + , alpha_jump(alpha_jump) +{ +} + +double ZoniGyroCoefficients::alpha(const double& r) const +{ + return exp(-tanh(10.0 * (r / Rmax) - 5.0)); +} + +double ZoniGyroCoefficients::beta(const double& r) const +{ + return exp(tanh(10.0 * (r / Rmax) - 5.0)); +} + +double ZoniGyroCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp new file mode 100644 index 00000000..77c8635f --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include +ZoniShiftedCoefficients::ZoniShiftedCoefficients(const double& Rmax, const double& alpha_jump) + : Rmax(Rmax) + , alpha_jump(alpha_jump) +{ +} + +double ZoniShiftedCoefficients::alpha(const double& r) const +{ + return exp(-tanh(20.0 * (r / Rmax) - 14.0)); +} + +double ZoniShiftedCoefficients::beta(const double& r) const +{ + return 0.0; +} + +double ZoniShiftedCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp new file mode 100644 index 00000000..43fa16c9 --- /dev/null +++ b/src/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.cpp @@ -0,0 +1,22 @@ +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h" + +ZoniShiftedGyroCoefficients::ZoniShiftedGyroCoefficients(const double& Rmax, const double& alpha_jump) + : Rmax(Rmax) + , alpha_jump(alpha_jump) +{ +} + +double ZoniShiftedGyroCoefficients::alpha(const double& r) const +{ + return exp(-tanh(20.0 * (r / Rmax) - 14.0)); +} + +double ZoniShiftedGyroCoefficients::beta(const double& r) const +{ + return exp(tanh(20.0 * (r / Rmax) - 14.0)); +} + +double ZoniShiftedGyroCoefficients::getAlphaJump() const +{ + return alpha_jump; +} diff --git a/src/InputFunctions/DomainGeometry/circularGeometry.cpp b/src/InputFunctions/DomainGeometry/circularGeometry.cpp new file mode 100644 index 00000000..030fb066 --- /dev/null +++ b/src/InputFunctions/DomainGeometry/circularGeometry.cpp @@ -0,0 +1,6 @@ +#include "../include/InputFunctions/DomainGeometry/circularGeometry.h" + +CircularGeometry::CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} diff --git a/src/InputFunctions/DomainGeometry/culhamGeometry.cpp b/src/InputFunctions/DomainGeometry/culhamGeometry.cpp new file mode 100644 index 00000000..85fdce1d --- /dev/null +++ b/src/InputFunctions/DomainGeometry/culhamGeometry.cpp @@ -0,0 +1,108 @@ +#include "../include/InputFunctions/DomainGeometry/culhamGeometry.h" + +CulhamGeometry::CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ + initializeGeometry(); +} + +CulhamGeometry::CulhamGeometry() +{ + initializeGeometry(); +} + +void CulhamGeometry::initializeGeometry() +{ + rr = 0.0; + dr = 1.0 / 1000; + dr_h = dr * 0.5; + g_array[0] = 1.0; + E_array[0] = 0.0; + E_prime_array[0] = 1.0; + T_array[0] = 0.0; + T_prime_array[0] = 0.0; + r[0] = rr; + rr += dr; + r[1] = rr; + g_array[1] = 1.0; + E_array[1] = rr; + E_prime_array[1] = 1.0; + T_array[1] = rr * rr; + T_prime_array[1] = 2 * rr; + for (i = 1; i < 1000; i += 1) { + /*Step 1*/ + dg_1 = dg(rr, g_array[i]); + dE_1 = E_prime_array[i]; + dT_1 = T_prime_array[i]; + ddE_1 = double_deriv(rr, 3.0, g_array[i], dg_1, E_array[i], E_prime_array[i]); + ddT_1 = double_deriv(rr, 8.0, g_array[i], dg_1, T_array[i], T_prime_array[i]); + /*Step 2*/ + r2 = rr + dr_h; + g_2 = g_array[i] + dr_h * dg_1; + dg_2 = dg(r2, g_2); + E_2 = E_array[i] + dE_1 * dr_h; + T_2 = T_array[i] + dT_1 * dr_h; + dE_2 = E_prime_array[i] + ddE_1 * dr_h; + dT_2 = T_prime_array[i] + ddT_1 * dr_h; + ddE_2 = double_deriv(r2, 3.0, g_2, dg_2, E_2, dE_2); + ddT_2 = double_deriv(r2, 8.0, g_2, dg_2, T_2, dT_2); + /*Step 3*/ + g_3 = g_array[i] + dr_h * dg_2; + dg_3 = dg(r2, g_3); + E_3 = E_array[i] + dE_2 * dr_h; + T_3 = T_array[i] + dT_2 * dr_h; + dE_3 = E_prime_array[i] + ddE_2 * dr_h; + dT_3 = T_prime_array[i] + ddT_2 * dr_h; + ddE_3 = double_deriv(r2, 3.0, g_3, dg_3, E_3, dE_3); + ddT_3 = double_deriv(r2, 8.0, g_3, dg_3, T_3, dT_3); + /*Step 4*/ + rr = rr + dr; + g_4 = g_array[i] + dr * dg_3; + dg_4 = dg(rr, g_4); + E_4 = E_array[i] + dE_3 * dr; + T_4 = T_array[i] + dT_3 * dr; + dE_4 = E_prime_array[i] + ddE_3 * dr; + dT_4 = T_prime_array[i] + ddT_3 * dr; + ddE_4 = double_deriv(rr, 3.0, g_4, dg_4, E_4, dE_4); + ddT_4 = double_deriv(rr, 8.0, g_4, dg_4, T_4, dT_4); + g_array[i + 1] = g_array[i] + dr * (dg_1 + 2 * dg_2 + 2 * dg_3 + dg_4) / 6.0; + E_array[i + 1] = E_array[i] + dr * (dE_1 + 2 * dE_2 + 2 * dE_3 + dE_4) / 6.0; + T_array[i + 1] = T_array[i] + dr * (dT_1 + 2 * dT_2 + 2 * dT_3 + dT_4) / 6.0; + E_prime_array[i + 1] = E_prime_array[i] + dr * (ddE_1 + 2 * ddE_2 + 2 * ddE_3 + ddE_4) / 6.0; + T_prime_array[i + 1] = T_prime_array[i] + dr * (ddT_1 + 2 * ddT_2 + 2 * ddT_3 + ddT_4) / 6.0; + r[i + 1] = rr; + } + current_Ea = E(1.0); + current_Ta = T(1.0); + for (i_0001 = 0; i_0001 < E_array.size(); i_0001 += 1) { + E_array[i_0001] = 0.25 * E_array[i_0001] / current_Ea; + } + for (i_0001 = 0; i_0001 < T_array.size(); i_0001 += 1) { + T_array[i_0001] = 0.1 * T_array[i_0001] / current_Ta; + } + for (i_0001 = 0; i_0001 < E_prime_array.size(); i_0001 += 1) { + E_prime_array[i_0001] = 0.25 * E_prime_array[i_0001] / current_Ea; + } + for (i_0001 = 0; i_0001 < T_prime_array.size(); i_0001 += 1) { + T_prime_array[i_0001] = 0.1 * T_prime_array[i_0001] / current_Ta; + } + for (i_0001 = 0; i_0001 < f.size(); i_0001 += 1) { + f[i_0001] = r[i_0001] * g_array[i_0001] / 5.0 / q(r[i_0001]); + } + for (i_0001 = 0; i_0001 < integ_contents.size(); i_0001 += 1) { + integ_contents[i_0001] = r[i_0001] * (f[i_0001] * f[i_0001]) - + 2 * (r[i_0001] * r[i_0001]) * 1.25663706212e-06 * dp(r[i_0001]) / (1.0 * 1.0); + } + Delta_prime_array[0] = 0; + Delta_array[0] = 0; + integral = 0.0; + for (i = 1; i < 1000 + 1; i += 1) { + integral += dr * (integ_contents[i - 1] + integ_contents[i]) * 0.5; + Delta_prime_array[i] = (-integral) / (5.0 * r[i] * pow(f[i], 2.0)); + Delta_array[i] = Delta_array[i - 1] + dr * 0.5 * (Delta_prime_array[i - 1] + Delta_prime_array[i]); + } + current_Delta_a = Delta(1.0); + for (i_0001 = 0; i_0001 < Delta_array.size(); i_0001 += 1) { + Delta_array[i_0001] -= current_Delta_a; + } +} diff --git a/src/InputFunctions/DomainGeometry/czarnyGeometry.cpp b/src/InputFunctions/DomainGeometry/czarnyGeometry.cpp new file mode 100644 index 00000000..24c79d6b --- /dev/null +++ b/src/InputFunctions/DomainGeometry/czarnyGeometry.cpp @@ -0,0 +1,20 @@ +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" + +CzarnyGeometry::CzarnyGeometry() +{ + initializeGeometry(); +} + +CzarnyGeometry::CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +void CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} diff --git a/src/InputFunctions/DomainGeometry/shafranovGeometry.cpp b/src/InputFunctions/DomainGeometry/shafranovGeometry.cpp new file mode 100644 index 00000000..c6d8eb5f --- /dev/null +++ b/src/InputFunctions/DomainGeometry/shafranovGeometry.cpp @@ -0,0 +1,8 @@ +#include "../include/InputFunctions/DomainGeometry/shafranovGeometry.h" + +ShafranovGeometry::ShafranovGeometry(const double& Rmax, const double& elongation_kappa, const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} \ No newline at end of file diff --git a/src/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.cpp b/src/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.cpp new file mode 100644 index 00000000..d84d2c7d --- /dev/null +++ b/src/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.cpp @@ -0,0 +1,13 @@ +#include "../include/InputFunctions/ExactSolution/cartesianR2_CircularGeometry.h" + +CartesianR2_CircularGeometry::CartesianR2_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_CircularGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} \ No newline at end of file diff --git a/src/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.cpp b/src/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.cpp new file mode 100644 index 00000000..b514ce14 --- /dev/null +++ b/src/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.cpp @@ -0,0 +1,25 @@ +#include "../include/InputFunctions/ExactSolution/cartesianR2_CzarnyGeometry.h" + +void CartesianR2_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_CzarnyGeometry::CartesianR2_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_CzarnyGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r / Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / (2.0 - temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon); +} diff --git a/src/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.cpp b/src/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.cpp new file mode 100644 index 00000000..e6b5b7ed --- /dev/null +++ b/src/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.cpp @@ -0,0 +1,18 @@ +#include "../include/InputFunctions/ExactSolution/cartesianR2_ShafranovGeometry.h" + +CartesianR2_ShafranovGeometry::CartesianR2_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_ShafranovGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)); +} \ No newline at end of file diff --git a/src/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.cpp b/src/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.cpp new file mode 100644 index 00000000..5746e663 --- /dev/null +++ b/src/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.cpp @@ -0,0 +1,13 @@ +#include "../include/InputFunctions/ExactSolution/cartesianR6_CircularGeometry.h" + +CartesianR6_CircularGeometry::CartesianR6_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_CircularGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} \ No newline at end of file diff --git a/src/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.cpp b/src/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.cpp new file mode 100644 index 00000000..63ba68a7 --- /dev/null +++ b/src/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.cpp @@ -0,0 +1,25 @@ +#include "../include/InputFunctions/ExactSolution/cartesianR6_CzarnyGeometry.h" + +void CartesianR6_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_CzarnyGeometry::CartesianR6_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_CzarnyGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (2.0 * (r / Rmax) * cos_theta + inverse_aspect_ratio_epsilon) + 1.0); + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / (2.0 - temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon); +} diff --git a/src/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.cpp b/src/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.cpp new file mode 100644 index 00000000..5cb968f3 --- /dev/null +++ b/src/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.cpp @@ -0,0 +1,18 @@ +#include "../include/InputFunctions/ExactSolution/cartesianR6_ShafranovGeometry.h" + +CartesianR6_ShafranovGeometry::CartesianR6_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_ShafranovGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)); +} diff --git a/src/InputFunctions/ExactSolution/polarR6_CircularGeometry.cpp b/src/InputFunctions/ExactSolution/polarR6_CircularGeometry.cpp new file mode 100644 index 00000000..1f419d0d --- /dev/null +++ b/src/InputFunctions/ExactSolution/polarR6_CircularGeometry.cpp @@ -0,0 +1,12 @@ +#include "../include/InputFunctions/ExactSolution/polarR6_CircularGeometry.h" + +PolarR6_CircularGeometry::PolarR6_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_CircularGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} diff --git a/src/InputFunctions/ExactSolution/polarR6_CulhamGeometry.cpp b/src/InputFunctions/ExactSolution/polarR6_CulhamGeometry.cpp new file mode 100644 index 00000000..c1e66e5c --- /dev/null +++ b/src/InputFunctions/ExactSolution/polarR6_CulhamGeometry.cpp @@ -0,0 +1,12 @@ +#include "../include/InputFunctions/ExactSolution/polarR6_CulhamGeometry.h" + +PolarR6_CulhamGeometry::PolarR6_CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_CulhamGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.0; +} diff --git a/src/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.cpp b/src/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.cpp new file mode 100644 index 00000000..48891db4 --- /dev/null +++ b/src/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.cpp @@ -0,0 +1,21 @@ +#include "../include/InputFunctions/ExactSolution/polarR6_CzarnyGeometry.h" + +void PolarR6_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_CzarnyGeometry::PolarR6_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_CzarnyGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} diff --git a/src/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.cpp b/src/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.cpp new file mode 100644 index 00000000..57ff350e --- /dev/null +++ b/src/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.cpp @@ -0,0 +1,15 @@ +#include "../include/InputFunctions/ExactSolution/polarR6_ShafranovGeometry.h" + +PolarR6_ShafranovGeometry::PolarR6_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_ShafranovGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} \ No newline at end of file diff --git a/src/InputFunctions/ExactSolution/refined_CircularGeometry.cpp b/src/InputFunctions/ExactSolution/refined_CircularGeometry.cpp new file mode 100644 index 00000000..e6c4c810 --- /dev/null +++ b/src/InputFunctions/ExactSolution/refined_CircularGeometry.cpp @@ -0,0 +1,17 @@ +#include "../include/InputFunctions/ExactSolution/refined_CircularGeometry.h" + +Refined_CircularGeometry::Refined_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double Refined_CircularGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} diff --git a/src/InputFunctions/ExactSolution/refined_CulhamGeometry.cpp b/src/InputFunctions/ExactSolution/refined_CulhamGeometry.cpp new file mode 100644 index 00000000..b8f81faf --- /dev/null +++ b/src/InputFunctions/ExactSolution/refined_CulhamGeometry.cpp @@ -0,0 +1,12 @@ +#include "../include/InputFunctions/ExactSolution/refined_CulhamGeometry.h" + +Refined_CulhamGeometry::Refined_CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double Refined_CulhamGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.0; +} diff --git a/src/InputFunctions/ExactSolution/refined_CzarnyGeometry.cpp b/src/InputFunctions/ExactSolution/refined_CzarnyGeometry.cpp new file mode 100644 index 00000000..5f51c9f3 --- /dev/null +++ b/src/InputFunctions/ExactSolution/refined_CzarnyGeometry.cpp @@ -0,0 +1,26 @@ +#include "../include/InputFunctions/ExactSolution/refined_CzarnyGeometry.h" + +void Refined_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +Refined_CzarnyGeometry::Refined_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double Refined_CzarnyGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} diff --git a/src/InputFunctions/ExactSolution/refined_ShafranovGeometry.cpp b/src/InputFunctions/ExactSolution/refined_ShafranovGeometry.cpp new file mode 100644 index 00000000..3811fbde --- /dev/null +++ b/src/InputFunctions/ExactSolution/refined_ShafranovGeometry.cpp @@ -0,0 +1,20 @@ +#include "../include/InputFunctions/ExactSolution/refined_ShafranovGeometry.h" + +Refined_ShafranovGeometry::Refined_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double Refined_ShafranovGeometry::exact_solution(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp new file mode 100644 index 00000000..fedf127b --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.cpp @@ -0,0 +1,20 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_CircularGeometry.h" + +CartesianR2_Poisson_CircularGeometry::CartesianR2_Poisson_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_Poisson_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 8.0 * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 4.0 * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp new file mode 100644 index 00000000..536e6bf7 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.cpp @@ -0,0 +1,1043 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_CzarnyGeometry.h" + +void CartesianR2_Poisson_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_Poisson_CzarnyGeometry::CartesianR2_Poisson_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_Poisson_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-1.0) * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * pow(cos_theta, 2.0) / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))), + (3.0 / 2.0)) - + 1.0 * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) + + 1.0 * (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) - + 1.0 * (r / Rmax) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * pow(cos_theta, 2.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) + + 1.0 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + pow(cos_theta, 2.0) / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / + (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) + + 1.0 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * pow(cos_theta, 2.0) / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * pow(cos_theta, 2.0) * (factor_xi * temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))), + (3.0 / 2.0)) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * pow(cos_theta, 2.0) / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * pow(cos_theta, 2.0) / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))), + (3.0 / 2.0)) + + 1.0 * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * pow(cos_theta, 2.0) / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) + + 1.0 * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * pow(cos_theta, 2.0) / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * pow(cos_theta, 2.0) / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))), + (3.0 / 2.0)) + + 1.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) + + 1.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))) - + 1.0 * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(cos_theta, 2.0) * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - pow(cos_theta, 2.0) / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + pow(cos_theta, 2.0) / (temp * temp)))); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp new file mode 100644 index 00000000..30e2a9a9 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.cpp @@ -0,0 +1,473 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Poisson_ShafranovGeometry.h" + +CartesianR2_Poisson_ShafranovGeometry::CartesianR2_Poisson_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_Poisson_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 1.0 * (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 1.0 * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * elongation_kappa - 2.0), 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 1.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp new file mode 100644 index 00000000..e9549d4d --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.cpp @@ -0,0 +1,57 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h" + +CartesianR2_SonnendruckerGyro_CircularGeometry::CartesianR2_SonnendruckerGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_SonnendruckerGyro_CircularGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + ((r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-8.0) * M_PI * (r / Rmax) * sin(theta) * cos(2.0 * M_PI * (r / Rmax) * sin(theta)) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) + + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + sin(2.0 * M_PI * (r / Rmax) * cos(theta)) * cos(theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin(theta), 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * cos(2.0 * M_PI * (r / Rmax) * cos(theta)) - + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(theta) * + sin(2.0 * M_PI * (r / Rmax) * cos(theta)) * cos(theta) * + cos(2.0 * M_PI * (r / Rmax) * sin(theta)) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos(theta)) - + 2.0 * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * cos(2.0 * M_PI * (r / Rmax) * cos(theta))) - + 5.03290747193186 * (r / Rmax) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(theta) * cos(2.0 * M_PI * (r / Rmax) * sin(theta)) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + sin(2.0 * M_PI * (r / Rmax) * cos(theta)) * cos(theta)) / + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(theta) * cos(2.0 * M_PI * (r / Rmax) * sin(theta)) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + sin(2.0 * M_PI * (r / Rmax) * cos(theta)) * cos(theta)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin(theta), 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * cos(2.0 * M_PI * (r / Rmax) * cos(theta)) + + 8.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(theta) * + sin(2.0 * M_PI * (r / Rmax) * cos(theta)) * cos(theta) * + cos(2.0 * M_PI * (r / Rmax) * sin(theta)) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * pow(cos(theta), 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(theta) * cos(2.0 * M_PI * (r / Rmax) * sin(theta)) * + cos(2.0 * M_PI * (r / Rmax) * cos(theta)) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin(theta)) * + sin(2.0 * M_PI * (r / Rmax) * cos(theta)) * cos(theta))) / + (r / Rmax); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..6c8418f4 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.cpp @@ -0,0 +1,1113 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CzarnyGeometry.h" + +void CartesianR2_SonnendruckerGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_SonnendruckerGyro_CzarnyGeometry::CartesianR2_SonnendruckerGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_SonnendruckerGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + ((-(r / Rmax)) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + 5.03290747193186 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..118ed534 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.cpp @@ -0,0 +1,527 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_ShafranovGeometry.h" + +CartesianR2_SonnendruckerGyro_ShafranovGeometry::CartesianR2_SonnendruckerGyro_ShafranovGeometry( + const double& Rmax, const double& elongation_kappa, const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_SonnendruckerGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + (2.0 * shift_delta * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 5.03290747193186 * (r / Rmax) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp new file mode 100644 index 00000000..5018f0bf --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.cpp @@ -0,0 +1,52 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CircularGeometry.h" + +CartesianR2_Sonnendrucker_CircularGeometry::CartesianR2_Sonnendrucker_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_Sonnendrucker_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-8.0) * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) - + 5.03290747193186 * (r / Rmax) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) / + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp new file mode 100644 index 00000000..b37ade61 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.cpp @@ -0,0 +1,1120 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_CzarnyGeometry.h" + +void CartesianR2_Sonnendrucker_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_Sonnendrucker_CzarnyGeometry::CartesianR2_Sonnendrucker_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_Sonnendrucker_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-(r / Rmax)) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + 5.03290747193186 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp new file mode 100644 index 00000000..5e30a5c3 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.cpp @@ -0,0 +1,526 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Sonnendrucker_ShafranovGeometry.h" + +CartesianR2_Sonnendrucker_ShafranovGeometry::CartesianR2_Sonnendrucker_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_Sonnendrucker_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 5.03290747193186 * (r / Rmax) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * elongation_kappa - 2.0), 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp new file mode 100644 index 00000000..c184cf99 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.cpp @@ -0,0 +1,53 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CircularGeometry.h" + +CartesianR2_ZoniGyro_CircularGeometry::CartesianR2_ZoniGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_ZoniGyro_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + ((r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (r / Rmax) * + ((-8.0) * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..86b27c8d --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.cpp @@ -0,0 +1,1114 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_CzarnyGeometry.h" + +void CartesianR2_ZoniGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_ZoniGyro_CzarnyGeometry::CartesianR2_ZoniGyro_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_ZoniGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + ((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..b10f72d6 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.cpp @@ -0,0 +1,525 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniGyro_ShafranovGeometry.h" + +CartesianR2_ZoniGyro_ShafranovGeometry::CartesianR2_ZoniGyro_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_ZoniGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)) - + (2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp new file mode 100644 index 00000000..66d40134 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.cpp @@ -0,0 +1,53 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CircularGeometry.h" + +CartesianR2_ZoniShiftedGyro_CircularGeometry::CartesianR2_ZoniShiftedGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_ZoniShiftedGyro_CircularGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + ((r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + ((-8.0) * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0))) / + (r / Rmax); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..60664cc3 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -0,0 +1,1113 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_CzarnyGeometry.h" + +void CartesianR2_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_ZoniShiftedGyro_CzarnyGeometry::CartesianR2_ZoniShiftedGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_ZoniShiftedGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + ((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..b82fd2dc --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -0,0 +1,524 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShiftedGyro_ShafranovGeometry.h" + +CartesianR2_ZoniShiftedGyro_ShafranovGeometry::CartesianR2_ZoniShiftedGyro_ShafranovGeometry( + const double& Rmax, const double& elongation_kappa, const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_ZoniShiftedGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return (1.0 - (r / Rmax) * (r / Rmax)) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)) - + (2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp new file mode 100644 index 00000000..47e640bd --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.cpp @@ -0,0 +1,52 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CircularGeometry.h" + +CartesianR2_ZoniShifted_CircularGeometry::CartesianR2_ZoniShifted_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_ZoniShifted_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + ((-8.0) * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp new file mode 100644 index 00000000..2a0ea22b --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.cpp @@ -0,0 +1,1121 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_CzarnyGeometry.h" + +void CartesianR2_ZoniShifted_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_ZoniShifted_CzarnyGeometry::CartesianR2_ZoniShifted_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_ZoniShifted_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp new file mode 100644 index 00000000..1d6137e0 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.cpp @@ -0,0 +1,524 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_ZoniShifted_ShafranovGeometry.h" + +CartesianR2_ZoniShifted_ShafranovGeometry::CartesianR2_ZoniShifted_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_ZoniShifted_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * elongation_kappa - 2.0), 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp new file mode 100644 index 00000000..2186548f --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.cpp @@ -0,0 +1,52 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_CircularGeometry.h" + +CartesianR2_Zoni_CircularGeometry::CartesianR2_Zoni_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR2_Zoni_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (r / Rmax) * + ((-8.0) * M_PI * (r / Rmax) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 8.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + pow(cos_theta, 2.0) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + ((-2.0) * (r / Rmax) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * pow(sin_theta, 2.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 8.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp new file mode 100644 index 00000000..9db388ea --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.cpp @@ -0,0 +1,1122 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_CzarnyGeometry.h" + +void CartesianR2_Zoni_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR2_Zoni_CzarnyGeometry::CartesianR2_Zoni_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR2_Zoni_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * (r / Rmax) * sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 4.0 * (r / Rmax) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 8.0 * M_PI * (r / Rmax) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp - + (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 4.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.0 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 2.0 * ((r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 4.0 * M_PI * ((r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 2.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + ((1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-2.0) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + sin_theta_pow2 * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 4.0 * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-2.0) * (r / Rmax) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + (1.0 - (r / Rmax) * (r / Rmax)) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp new file mode 100644 index 00000000..5598897d --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.cpp @@ -0,0 +1,524 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR2_Zoni_ShafranovGeometry.h" + +CartesianR2_Zoni_ShafranovGeometry::CartesianR2_Zoni_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR2_Zoni_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (4.0 * M_PI * shift_delta * (1.0 - (r / Rmax) * (r / Rmax)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * (r / Rmax) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.0 * M_PI * (r / Rmax) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * pow((elongation_kappa + 1.0), 2.0) * + pow(sin_theta, 2.0) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-4.0) * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((2.0 * elongation_kappa - 2.0), 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-M_PI) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.0 * M_PI * ((r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 4.0 * (M_PI * M_PI) * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * + pow((elongation_kappa + 1.0), 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + M_PI * M_PI * (r / Rmax) * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa - 2.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * (r / Rmax) * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * (2.0 * elongation_kappa + 2.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + M_PI * (1.0 - (r / Rmax) * (r / Rmax)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp new file mode 100644 index 00000000..ee77f7e4 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.cpp @@ -0,0 +1,48 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_CircularGeometry.h" + +CartesianR6_Poisson_CircularGeometry::CartesianR6_Poisson_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_Poisson_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 1.0 * (r / Rmax) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp new file mode 100644 index 00000000..ba1683e0 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.cpp @@ -0,0 +1,1098 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_CzarnyGeometry.h" + +void CartesianR6_Poisson_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_Poisson_CzarnyGeometry::CartesianR6_Poisson_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_Poisson_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-1.0) * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + 1.0 * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 1.0 * (r / Rmax) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * (factor_xi * temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 1.0 * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 1.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 1.0 * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * (factor_xi * (2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp new file mode 100644 index 00000000..4d90286d --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.cpp @@ -0,0 +1,576 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Poisson_ShafranovGeometry.h" + +CartesianR6_Poisson_ShafranovGeometry::CartesianR6_Poisson_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_Poisson_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 1.0 * (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 1.0 * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 1.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp new file mode 100644 index 00000000..a8965ba7 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.cpp @@ -0,0 +1,72 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CircularGeometry.h" + +CartesianR6_SonnendruckerGyro_CircularGeometry::CartesianR6_SonnendruckerGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_SonnendruckerGyro_CircularGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + ((r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) - + 5.03290747193186 * (r / Rmax) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) / + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta)) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..9f5e5084 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.cpp @@ -0,0 +1,1172 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_CzarnyGeometry.h" + +void CartesianR6_SonnendruckerGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_SonnendruckerGyro_CzarnyGeometry::CartesianR6_SonnendruckerGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_SonnendruckerGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + ((-(r / Rmax)) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + 5.03290747193186 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..812aabab --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.cpp @@ -0,0 +1,633 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_SonnendruckerGyro_ShafranovGeometry.h" + +CartesianR6_SonnendruckerGyro_ShafranovGeometry::CartesianR6_SonnendruckerGyro_ShafranovGeometry( + const double& Rmax, const double& elongation_kappa, const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_SonnendruckerGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + (2.0 * shift_delta * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 5.03290747193186 * (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp new file mode 100644 index 00000000..f892cf07 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.cpp @@ -0,0 +1,70 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CircularGeometry.h" + +CartesianR6_Sonnendrucker_CircularGeometry::CartesianR6_Sonnendrucker_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_Sonnendrucker_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) - + 5.03290747193186 * (r / Rmax) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) / + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * + cos_theta))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp new file mode 100644 index 00000000..1532e9a6 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.cpp @@ -0,0 +1,1180 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_CzarnyGeometry.h" + +void CartesianR6_Sonnendrucker_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_Sonnendrucker_CzarnyGeometry::CartesianR6_Sonnendrucker_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_Sonnendrucker_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-(r / Rmax)) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + 5.03290747193186 * (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp new file mode 100644 index 00000000..2a038425 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.cpp @@ -0,0 +1,638 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Sonnendrucker_ShafranovGeometry.h" + +CartesianR6_Sonnendrucker_ShafranovGeometry::CartesianR6_Sonnendrucker_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_Sonnendrucker_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 5.03290747193186 * (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 5.03290747193186 * (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp new file mode 100644 index 00000000..be053e89 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.cpp @@ -0,0 +1,71 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CircularGeometry.h" + +CartesianR6_ZoniGyro_CircularGeometry::CartesianR6_ZoniGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_ZoniGyro_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + ((r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (r / Rmax) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..a6ffccee --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.cpp @@ -0,0 +1,1173 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_CzarnyGeometry.h" + +void CartesianR6_ZoniGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_ZoniGyro_CzarnyGeometry::CartesianR6_ZoniGyro_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_ZoniGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + ((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..eebd4af3 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.cpp @@ -0,0 +1,631 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h" + +CartesianR6_ZoniGyro_ShafranovGeometry::CartesianR6_ZoniGyro_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_ZoniGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)) - + (2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp new file mode 100644 index 00000000..53ca350f --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.cpp @@ -0,0 +1,71 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CircularGeometry.h" + +CartesianR6_ZoniShiftedGyro_CircularGeometry::CartesianR6_ZoniShiftedGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_ZoniShiftedGyro_CircularGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + ((r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..33981d63 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -0,0 +1,1172 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_CzarnyGeometry.h" + +void CartesianR6_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_ZoniShiftedGyro_CzarnyGeometry::CartesianR6_ZoniShiftedGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_ZoniShiftedGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + ((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..70c59390 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -0,0 +1,630 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShiftedGyro_ShafranovGeometry.h" + +CartesianR6_ZoniShiftedGyro_ShafranovGeometry::CartesianR6_ZoniShiftedGyro_ShafranovGeometry( + const double& Rmax, const double& elongation_kappa, const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_ZoniShiftedGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, + const double& sin_theta, const double& cos_theta) const +{ + return 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + sin(M_PI * (2.0 * elongation_kappa * (r / Rmax) * sin_theta + 2.0 * (r / Rmax) * sin_theta)) * + cos(M_PI * ((-2.0) * shift_delta * ((r / Rmax) * (r / Rmax)) - + 2.0 * elongation_kappa * (r / Rmax) * cos_theta + 2.0 * (r / Rmax) * cos_theta)) - + (2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp new file mode 100644 index 00000000..680746f2 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.cpp @@ -0,0 +1,69 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CircularGeometry.h" + +CartesianR6_ZoniShifted_CircularGeometry::CartesianR6_ZoniShifted_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_ZoniShifted_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp new file mode 100644 index 00000000..1a3a34b5 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.cpp @@ -0,0 +1,1181 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_CzarnyGeometry.h" + +void CartesianR6_ZoniShifted_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_ZoniShifted_CzarnyGeometry::CartesianR6_ZoniShifted_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_ZoniShifted_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp new file mode 100644 index 00000000..4a877b5b --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.cpp @@ -0,0 +1,636 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniShifted_ShafranovGeometry.h" + +CartesianR6_ZoniShifted_ShafranovGeometry::CartesianR6_ZoniShifted_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_ZoniShifted_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp new file mode 100644 index 00000000..bcb6841d --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.cpp @@ -0,0 +1,69 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_CircularGeometry.h" + +CartesianR6_Zoni_CircularGeometry::CartesianR6_Zoni_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double CartesianR6_Zoni_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-((r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (r / Rmax) * + ((-1.6384) * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 3.2768 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * sin(2.0 * M_PI * (r / Rmax) * sin_theta) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 3.2768 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * pow(cos_theta, 2.0) * + cos(2.0 * M_PI * (r / Rmax) * cos_theta) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(2.0 * M_PI * (r / Rmax) * sin_theta) * cos(2.0 * M_PI * (r / Rmax) * cos_theta) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (r / Rmax) * sin_theta) * sin(2.0 * M_PI * (r / Rmax) * cos_theta) * cos_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)))) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp new file mode 100644 index 00000000..5ddef1e3 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.cpp @@ -0,0 +1,1182 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_CzarnyGeometry.h" + +void CartesianR6_Zoni_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +CartesianR6_Zoni_CzarnyGeometry::CartesianR6_Zoni_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double CartesianR6_Zoni_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-((-(r / Rmax)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (r / Rmax) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (r / Rmax) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow((2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 1.6384 * (M_PI * M_PI) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta_pow2 * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 1.6384 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 4.9152 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 4.9152 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 9.8304 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (0.8192 * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta * cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) + + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * cos_theta * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp - + 0.8192 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 4.9152 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + ((-0.8192) * M_PI * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta_pow2 * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / + pow((temp * temp), (3.0 / 2.0)) - + 0.4096 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) - + 1.6384 * (M_PI * M_PI) * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta_pow2 * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) / (temp * temp) - + 1.6384 * M_PI * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + sin_theta * sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) / temp + + 0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * M_PI * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) - + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos_theta / temp) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.4096 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + (2.0 * M_PI * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + 2.0 * M_PI * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + cos(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) + + 0.8192 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * cos_theta / + temp + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(2.0 * M_PI * ellipticity_e * (r / Rmax) * sin_theta * factor_xi / ((2.0 - temp))) * + cos(2.0 * M_PI * (1.0 - temp) / inverse_aspect_ratio_epsilon)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp new file mode 100644 index 00000000..52d056b8 --- /dev/null +++ b/src/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.cpp @@ -0,0 +1,636 @@ +#include "../include/InputFunctions/SourceTerms/cartesianR6_Zoni_ShafranovGeometry.h" + +CartesianR6_Zoni_ShafranovGeometry::CartesianR6_Zoni_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double CartesianR6_Zoni_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-(2.0 * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa - 2.0) * (2.0 * elongation_kappa + 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (1.6384 * M_PI * shift_delta * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 1.6384 * (M_PI * M_PI) * pow((elongation_kappa + 1.0), 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 4.9152 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 12.288 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 4.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-2.0) * M_PI * shift_delta * (r / Rmax) + + M_PI * ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 29.4912 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 12.288 * pow(((r / Rmax) - 1.0), 4.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (r / Rmax) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * pow(cos_theta, 2.0) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * pow((2.0 * elongation_kappa - 2.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.8192 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta - + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-0.4096) * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-1.6384) * (M_PI * M_PI) * (r / Rmax) * pow((elongation_kappa + 1.0), 2.0) * + pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * + (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + pow(sin_theta, 2.0) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin_theta * sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * (M_PI * M_PI) * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos_theta * cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 5.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 5.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * (2.0 * elongation_kappa - 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * cos_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + (0.4096 * M_PI * (2.0 * elongation_kappa + 2.0) * pow(((r / Rmax) - 1.0), 6.0) * + pow(((r / Rmax) + 1.0), 6.0) * sin_theta * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + cos(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) - + 0.4096 * M_PI * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 6.0) * + ((-4.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta) * + sin(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * pow(((r / Rmax) + 1.0), 5.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + 2.0 * cos_theta)) + + 2.4576 * pow(((r / Rmax) - 1.0), 5.0) * pow(((r / Rmax) + 1.0), 6.0) * + sin(M_PI * (r / Rmax) * (2.0 * elongation_kappa + 2.0) * sin_theta) * + cos(M_PI * (r / Rmax) * + ((-2.0) * shift_delta * (r / Rmax) - 2.0 * elongation_kappa * cos_theta + + 2.0 * cos_theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp new file mode 100644 index 00000000..21267a04 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.cpp @@ -0,0 +1,16 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Poisson_CircularGeometry.h" + +PolarR6_Poisson_CircularGeometry::PolarR6_Poisson_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_Poisson_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * (14.7456 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 1.0 * (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - + 34.816 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp new file mode 100644 index 00000000..e54557c3 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.cpp @@ -0,0 +1,765 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Poisson_CzarnyGeometry.h" + +void PolarR6_Poisson_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_Poisson_CzarnyGeometry::PolarR6_Poisson_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_Poisson_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-pow((r / Rmax), 4.0)) * + (4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * (factor_xi * temp1 * temp))) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 1.0 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * (factor_xi * temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * + (factor_xi * temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * + (factor_xi * temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 1.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 1.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * (factor_xi * temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * + (factor_xi * temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * (factor_xi * temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) - + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + (factor_xi * temp1 * temp) + + ellipticity_e * cos_theta * (factor_xi * (2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + (factor_xi * temp1 * temp) + + ellipticity_e * sin_theta * (factor_xi * (2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} diff --git a/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp new file mode 100644 index 00000000..ad8f023d --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.cpp @@ -0,0 +1,260 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Poisson_ShafranovGeometry.h" + +PolarR6_Poisson_ShafranovGeometry::PolarR6_Poisson_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_Poisson_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((-9.0112) * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * sin_theta * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 1.0 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 1.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp new file mode 100644 index 00000000..63dbe98f --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.cpp @@ -0,0 +1,28 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CircularGeometry.h" + +PolarR6_SonnendruckerGyro_CircularGeometry::PolarR6_SonnendruckerGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_SonnendruckerGyro_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + pow((r / Rmax), 4.0) * + ((r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - + 5.03290747193186 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) / + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) - + 49.5616 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) + + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta))); +} diff --git a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..bb58502b --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.cpp @@ -0,0 +1,853 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_CzarnyGeometry.h" + +void PolarR6_SonnendruckerGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_SonnendruckerGyro_CzarnyGeometry::PolarR6_SonnendruckerGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_SonnendruckerGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + pow((r / Rmax), 4.0) * + (4.5056 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + 22.6762679055362 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + 5.03290747193186 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) + + 27.0336 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..8d81cbfd --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.cpp @@ -0,0 +1,319 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_SonnendruckerGyro_ShafranovGeometry.h" + +PolarR6_SonnendruckerGyro_ShafranovGeometry::PolarR6_SonnendruckerGyro_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_SonnendruckerGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) / + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) - + pow((r / Rmax), 4.0) * + ((-9.0112) * shift_delta * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * sin_theta * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 22.6762679055362 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 5.03290747193186 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 49.5616 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt( + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp new file mode 100644 index 00000000..2d49ac19 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.cpp @@ -0,0 +1,25 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CircularGeometry.h" + +PolarR6_Sonnendrucker_CircularGeometry::PolarR6_Sonnendrucker_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_Sonnendrucker_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - + 5.03290747193186 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) / + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) - + 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta) + + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp new file mode 100644 index 00000000..cea253e0 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.cpp @@ -0,0 +1,833 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_CzarnyGeometry.h" + +void PolarR6_Sonnendrucker_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_Sonnendrucker_CzarnyGeometry::PolarR6_Sonnendrucker_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_Sonnendrucker_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-pow((r / Rmax), 4.0)) * + (4.5056 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + 22.6762679055362 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) - + 5.03290747193186 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + ((208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0) * + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) + + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp new file mode 100644 index 00000000..b8140a43 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.cpp @@ -0,0 +1,302 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Sonnendrucker_ShafranovGeometry.h" + +PolarR6_Sonnendrucker_ShafranovGeometry::PolarR6_Sonnendrucker_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_Sonnendrucker_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((-9.0112) * shift_delta * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * sin_theta * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 22.6762679055362 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 5.03290747193186 * (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + (sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) * + (208.641975308642 * pow(((r / Rmax) - 0.769230769230769), 2.0) + 1.0)) - + 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r / Rmax) - 11.1111111111111)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp new file mode 100644 index 00000000..6516e7b7 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.cpp @@ -0,0 +1,27 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CircularGeometry.h" + +PolarR6_ZoniGyro_CircularGeometry::PolarR6_ZoniGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_ZoniGyro_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + cos(11.0 * theta) - + pow((r / Rmax), 4.0) * + ((r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..62eb72e7 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.cpp @@ -0,0 +1,841 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_CzarnyGeometry.h" + +void PolarR6_ZoniGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_ZoniGyro_CzarnyGeometry::PolarR6_ZoniGyro_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_ZoniGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + cos(11.0 * theta) - + pow((r / Rmax), 4.0) * + (4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..bb0891fe --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.cpp @@ -0,0 +1,308 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniGyro_ShafranovGeometry.h" + +PolarR6_ZoniGyro_ShafranovGeometry::PolarR6_ZoniGyro_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_ZoniGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r / Rmax) - 5.0)) * + cos(11.0 * theta) - + pow((r / Rmax), 4.0) * + ((-9.0112) * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin_theta * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt( + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp new file mode 100644 index 00000000..65d14f62 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.cpp @@ -0,0 +1,27 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CircularGeometry.h" + +PolarR6_ZoniShiftedGyro_CircularGeometry::PolarR6_ZoniShiftedGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_ZoniShiftedGyro_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + cos(11.0 * theta) - + pow((r / Rmax), 4.0) * + ((r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp new file mode 100644 index 00000000..77a4cf6d --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.cpp @@ -0,0 +1,12 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CulhamGeometry.h" + +PolarR6_ZoniShiftedGyro_CulhamGeometry::PolarR6_ZoniShiftedGyro_CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_ZoniShiftedGyro_CulhamGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..714b2995 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -0,0 +1,840 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_CzarnyGeometry.h" + +void PolarR6_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_ZoniShiftedGyro_CzarnyGeometry::PolarR6_ZoniShiftedGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_ZoniShiftedGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + cos(11.0 * theta) - + pow((r / Rmax), 4.0) * + (4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..25ce90bf --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -0,0 +1,308 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShiftedGyro_ShafranovGeometry.h" + +PolarR6_ZoniShiftedGyro_ShafranovGeometry::PolarR6_ZoniShiftedGyro_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_ZoniShiftedGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 0.4096 * pow((r / Rmax), 6.0) * pow(((r / Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r / Rmax) - 14.0)) * + cos(11.0 * theta) - + pow((r / Rmax), 4.0) * + ((-9.0112) * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt( + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp new file mode 100644 index 00000000..34427b13 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.cpp @@ -0,0 +1,25 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CircularGeometry.h" + +PolarR6_ZoniShifted_CircularGeometry::PolarR6_ZoniShifted_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_ZoniShifted_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp new file mode 100644 index 00000000..7f142648 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.cpp @@ -0,0 +1,824 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" + +void PolarR6_ZoniShifted_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_ZoniShifted_CzarnyGeometry::PolarR6_ZoniShifted_CzarnyGeometry(const double& Rmax, + const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_ZoniShifted_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-pow((r / Rmax), 4.0)) * + (4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} diff --git a/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp new file mode 100644 index 00000000..eaf9add3 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.cpp @@ -0,0 +1,295 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_ShafranovGeometry.h" + +PolarR6_ZoniShifted_ShafranovGeometry::PolarR6_ZoniShifted_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_ZoniShifted_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((-9.0112) * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp new file mode 100644 index 00000000..5d3af3f8 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.cpp @@ -0,0 +1,25 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Zoni_CircularGeometry.h" + +PolarR6_Zoni_CircularGeometry::PolarR6_Zoni_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double PolarR6_Zoni_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp new file mode 100644 index 00000000..59943ef6 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.cpp @@ -0,0 +1,823 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Zoni_CzarnyGeometry.h" + +void PolarR6_Zoni_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +PolarR6_Zoni_CzarnyGeometry::PolarR6_Zoni_CzarnyGeometry(const double& Rmax, const double& inverse_aspect_ratio_epsilon, + const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double PolarR6_Zoni_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return (-pow((r / Rmax), 4.0)) * + (4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) * + sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp new file mode 100644 index 00000000..369461b1 --- /dev/null +++ b/src/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.cpp @@ -0,0 +1,294 @@ +#include "../include/InputFunctions/SourceTerms/polarR6_Zoni_ShafranovGeometry.h" + +PolarR6_Zoni_ShafranovGeometry::PolarR6_Zoni_ShafranovGeometry(const double& Rmax, const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double PolarR6_Zoni_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return (-pow((r / Rmax), 4.0)) * + ((-9.0112) * shift_delta * (r / Rmax) * (elongation_kappa - 1.0) * pow(((r / Rmax) - 1.0), 6.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin_theta * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r / Rmax) - 5.0)) * + sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 4.5056 * (r / Rmax) * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + 27.0336 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (12.288 * (r / Rmax) * pow(((r / Rmax) - 1.0), 4.0) * cos(11.0 * theta) + + 17.2032 * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (10.0 * pow(tanh(10.0 * (r / Rmax) - 5.0), 2.0) - 10.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 49.5616 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * cos(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + 4.5056 * pow(((r / Rmax) - 1.0), 6.0) * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) * sin(11.0 * theta) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-27.0336) * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * sin(11.0 * theta) - + 27.0336 * pow(((r / Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + 6.0 * + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (2.4576 * (r / Rmax) * pow(((r / Rmax) - 1.0), 5.0) * cos(11.0 * theta) + + 2.4576 * pow(((r / Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(10.0 * (r / Rmax) - 5.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp new file mode 100644 index 00000000..152e09ef --- /dev/null +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.cpp @@ -0,0 +1,53 @@ +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CircularGeometry.h" + +Refined_ZoniShiftedGyro_CircularGeometry::Refined_ZoniShiftedGyro_CircularGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double Refined_ZoniShiftedGyro_CircularGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 1.0 * + (((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta)) * + exp(tanh(20.0 * (r / Rmax) - 14.0)) - + ((r / Rmax) * + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (r / Rmax) * + ((10000.0 * pow((0.45 - (r / Rmax)), 2.0) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) + + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta) + + (44444444.4444444 * pow((0.9 - (r / Rmax)), 2.0) * + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0)) - + 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) + + (21.0 * + (7.0102993702666e-14 * ((r / Rmax) * (r / Rmax)) - + 21.0 * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + 9.0 * + ((-0.0165846035000287) * ((r / Rmax) * (r / Rmax)) + 0.0162264454441452 * (r / Rmax) + + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / (r / Rmax)) / + (r / Rmax); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp new file mode 100644 index 00000000..ff214bd1 --- /dev/null +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.cpp @@ -0,0 +1,17 @@ +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h" + +Refined_ZoniShiftedGyro_CulhamGeometry::Refined_ZoniShiftedGyro_CulhamGeometry(const double& Rmax) + : Rmax(Rmax) +{ +} + +double Refined_ZoniShiftedGyro_CulhamGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - 4.00652973929511e-05 + + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp new file mode 100644 index 00000000..8eaa94aa --- /dev/null +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.cpp @@ -0,0 +1,883 @@ +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CzarnyGeometry.h" + +void Refined_ZoniShiftedGyro_CzarnyGeometry::initializeGeometry() +{ + factor_xi = 1.0 / sqrt(1.0 - inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon / 4.0); +} + +Refined_ZoniShiftedGyro_CzarnyGeometry::Refined_ZoniShiftedGyro_CzarnyGeometry( + const double& Rmax, const double& inverse_aspect_ratio_epsilon, const double& ellipticity_e) + : Rmax(Rmax) + , inverse_aspect_ratio_epsilon(inverse_aspect_ratio_epsilon) + , ellipticity_e(ellipticity_e) +{ + initializeGeometry(); +} + +double Refined_ZoniShiftedGyro_CzarnyGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + double temp = + sqrt(inverse_aspect_ratio_epsilon * (inverse_aspect_ratio_epsilon + 2.0 * (r / Rmax) * cos_theta) + 1.0); + double sin_theta_pow2 = pow(sin_theta, 2.0); + double cos_theta_pow2 = pow(cos_theta, 2.0); + double temp1 = pow((2.0 - temp), 2.0); + double temp2 = pow((2.0 - temp), 3.0); + + return 1.0 * + (((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta)) * + exp(tanh(20.0 * (r / Rmax) - 14.0)) - + ((r / Rmax) * + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + (r / Rmax) * + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (r / Rmax) * + ((10000.0 * pow((0.45 - (r / Rmax)), 2.0) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) + + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta) + + (44444444.4444444 * pow((0.9 - (r / Rmax)), 2.0) * + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0)) - + 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-21.0) * + ((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + sin(9.0 * theta)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) + + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + ((-2.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + sin_theta_pow2 / (temp * temp) - cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((1.40205987405332e-13 * (r / Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r / Rmax)) * + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) + + ((-0.0331692070000574) * (r / Rmax) - + 9.0 * (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) + 0.0162264454441452) * + sin(9.0 * theta)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) - + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + (4.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * pow(cos_theta, 3.0) / pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp))) * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + ((-2.0) * inverse_aspect_ratio_epsilon * sin_theta_pow2 * cos_theta / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + (r / Rmax) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / + (temp1 * temp))) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0)) - + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + (2.0 * inverse_aspect_ratio_epsilon * sin_theta * cos_theta_pow2 / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta * cos_theta_pow2 * factor_xi / (temp2 * (temp * temp)) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta * cos_theta * factor_xi / + (temp1 * temp)) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * (r / Rmax) * + sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + ellipticity_e * inverse_aspect_ratio_epsilon * sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * cos_theta_pow2 * factor_xi / (temp1 * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))) + + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))) + + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (1.0 / 2.0 * + (((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)) * + ((-4.0) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * cos_theta / + pow((temp * temp), 2.0) + + 2.0 * + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) + + 2.0 * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + ((-ellipticity_e) * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 3.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta_pow2 / (temp * temp) - 2.0 * cos_theta_pow2 / (temp * temp)) - + 1.0 / 2.0 * + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta_pow2 / + pow((temp * temp), 2.0) + + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) * + (2.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) - + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * sin_theta_pow2 * cos_theta * factor_xi / + (temp2 * (temp * temp)) - + 4.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * cos_theta_pow2 * + factor_xi / (temp1 * temp) + + 2.0 * ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) - + 2.0 * sin_theta * cos_theta / (temp * temp)) - + 1.0 / 2.0 * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + (2.0 * inverse_aspect_ratio_epsilon * (r / Rmax) * pow(sin_theta, 3.0) / pow((temp * temp), 2.0) + + ((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * factor_xi / + (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + ((-2.0) * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / + (temp1 * pow((temp * temp), (3.0 / 2.0))) + + 4.0 * ellipticity_e * (inverse_aspect_ratio_epsilon * inverse_aspect_ratio_epsilon) * + ((r / Rmax) * (r / Rmax)) * pow(sin_theta, 3.0) * factor_xi / (temp2 * (temp * temp)) - + 6.0 * ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * + factor_xi / (temp1 * temp) - + 2.0 * ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) + + 2.0 * sin_theta * cos_theta / (temp * temp))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + ((r / Rmax) * pow(((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))), + (3.0 / 2.0))) + + (21.0 * + (7.0102993702666e-14 * ((r / Rmax) * (r / Rmax)) - + 21.0 * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + 9.0 * + ((-0.0165846035000287) * ((r / Rmax) * (r / Rmax)) + 0.0162264454441452 * (r / Rmax) + + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * cos_theta * factor_xi / + (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp))))) / + ((r / Rmax) * sqrt((-pow((((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * + sin_theta_pow2 * factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))) * + (ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))) - + sin_theta * cos_theta / (temp * temp)), + 2.0)) + + (pow(((-ellipticity_e) * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta_pow2 * + factor_xi / (temp1 * temp) + + ellipticity_e * cos_theta * factor_xi / ((2.0 - temp))), + 2.0) + + sin_theta_pow2 / (temp * temp)) * + (pow((ellipticity_e * inverse_aspect_ratio_epsilon * (r / Rmax) * sin_theta * + cos_theta * factor_xi / (temp1 * temp) + + ellipticity_e * sin_theta * factor_xi / ((2.0 - temp))), + 2.0) + + cos_theta_pow2 / (temp * temp)))); +} \ No newline at end of file diff --git a/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp new file mode 100644 index 00000000..46cd84f6 --- /dev/null +++ b/src/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.cpp @@ -0,0 +1,370 @@ +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_ShafranovGeometry.h" + +Refined_ZoniShiftedGyro_ShafranovGeometry::Refined_ZoniShiftedGyro_ShafranovGeometry(const double& Rmax, + const double& elongation_kappa, + const double& shift_delta) + : Rmax(Rmax) + , elongation_kappa(elongation_kappa) + , shift_delta(shift_delta) +{ +} + +double Refined_ZoniShiftedGyro_ShafranovGeometry::rhs_f(const double& r, const double& theta, const double& sin_theta, + const double& cos_theta) const +{ + return 1.0 * + (((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) - 0.0 * (r / Rmax) - 0.0 + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta)) * + exp(tanh(20.0 * (r / Rmax) - 14.0)) - + (2.0 * shift_delta * (elongation_kappa - 1.0) * + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) * sin_theta / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (r / Rmax) * + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (r / Rmax) * + ((10000.0 * pow((0.45 - (r / Rmax)), 2.0) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) + + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta) + + (44444444.4444444 * pow((0.9 - (r / Rmax)), 2.0) * + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0)) - + 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-21.0) * + ((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + sin(9.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) + + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + (((-6.67647559073009e-15) * (r / Rmax) + + (6000.0 - 6666.66666666667 * (r / Rmax)) * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + (0.00368546744445083 * (r / Rmax) + + (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) - 0.0018029383826828) * + cos(9.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) - + ((1.40205987405332e-13 * (r / Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r / Rmax)) * + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) + + ((-0.0331692070000574) * (r / Rmax) - + 9.0 * (45.0 - 100.0 * (r / Rmax)) * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0)) + 0.0162264454441452) * + sin(9.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (20.0 * pow(tanh(20.0 * (r / Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)) - + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + ((-2.0) * shift_delta * (elongation_kappa - 1.0) * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + sin_theta + + 2.0 * shift_delta * ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0)) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + (4.0 * elongation_kappa * + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + sin_theta * cos_theta - + 1.0 / 2.0 * + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) + + 1.0 / 2.0 * + ((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)) * + (2.0 * pow((elongation_kappa - 1.0), 2.0) * pow(sin_theta, 2.0) + + 2.0 * (elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * cos_theta + + 2.0 * pow((elongation_kappa + 1.0), 2.0) * cos(2.0 * theta))) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + ((r / Rmax) * + pow(((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)), + (3.0 / 2.0))) + + (pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (21.0 * + (7.0102993702666e-14 * ((r / Rmax) * (r / Rmax)) - + 21.0 * exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + cos(21.0 * theta) + + 9.0 * + ((-0.0165846035000287) * ((r / Rmax) * (r / Rmax)) + 0.0162264454441452 * (r / Rmax) + + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + cos(9.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))) + + (pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta) + + (2.0 * elongation_kappa - 2.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * sin_theta) * + ((-21.0) * + ((-3.33823779536505e-15) * ((r / Rmax) * (r / Rmax)) + + exp((-3333.33333333333) * pow(((r / Rmax) - 0.9), 2.0))) * + sin(21.0 * theta) - + 9.0 * + (0.00184273372222541 * ((r / Rmax) * (r / Rmax)) - 0.0018029383826828 * (r / Rmax) - + 4.00652973929511e-05 + exp((-50.0) * pow(((r / Rmax) - 0.45), 2.0))) * + sin(9.0 * theta)) * + exp(-tanh(20.0 * (r / Rmax) - 14.0)) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0)))) / + ((r / Rmax) * + sqrt((pow((elongation_kappa + 1.0), 2.0) * pow(sin_theta, 2.0) + + pow(((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta), 2.0)) * + (elongation_kappa * elongation_kappa - 4.0 * elongation_kappa * pow(sin_theta, 2.0) + + 2.0 * elongation_kappa + 1.0) - + pow(((elongation_kappa - 1.0) * + ((-2.0) * shift_delta * (r / Rmax) - elongation_kappa * cos_theta + cos_theta) * + sin_theta + + 1.0 / 2.0 * pow((elongation_kappa + 1.0), 2.0) * sin(2.0 * theta)), + 2.0))); +} \ No newline at end of file diff --git a/src/Interpolation/extrapolated_prolongation.cpp b/src/Interpolation/extrapolated_prolongation.cpp new file mode 100644 index 00000000..8b386694 --- /dev/null +++ b/src/Interpolation/extrapolated_prolongation.cpp @@ -0,0 +1,143 @@ +#include "../../include/Interpolation/interpolation.h" + +void Interpolation::applyExtrapolatedProlongation0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() - 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& coarseGrid = fromLevel.grid(); + const PolarGrid& fineGrid = toLevel.grid(); + + assert(x.size() == coarseGrid.numberOfNodes()); + assert(result.size() == fineGrid.numberOfNodes()); + +#pragma omp parallel for + for (int index = 0; index < fineGrid.numberOfNodes(); index++) { + std::array, space_dimension> neighbor_distance; + + MultiIndex fine_node = fineGrid.multiIndex(index); + MultiIndex coarse_node(fine_node[0] / 2, fine_node[1] / 2); // Nearest lower left coarse node in the fine grid. + + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 0) { + // Fine node appears in coarse grid + result[index] = x[coarseGrid.index(coarse_node)]; + } + + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 1) { + // Fine node between two coarse nodes in theta direction + // X + // | + // O + // | + // X + MultiIndex bottomNeighbor(coarse_node[0], coarse_node[1]); + MultiIndex topNeighbor(coarse_node[0], (coarse_node[1] + 1) % coarseGrid.ntheta()); + result[index] = 0.5 * (x[coarseGrid.index(bottomNeighbor)] + x[coarseGrid.index(topNeighbor)]); + } + + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 0) { + // Fine node between two coarse nodes in radial direction + // X -- O -- X + MultiIndex leftNeighbor(coarse_node[0], coarse_node[1]); + MultiIndex rightNeighbor(coarse_node[0] + 1, coarse_node[1]); + result[index] = 0.5 * (x[coarseGrid.index(leftNeighbor)] + x[coarseGrid.index(rightNeighbor)]); + } + + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 1) { + // Interpolates a fine node value based on two neighboring coarse nodes. + // Fine node lies in the center of four coarse nodes forming a cross shape: + // + // X + /* \ */ + // O <-- Fine Node (i_r, i_theta) + /* \ */ + // X + // + MultiIndex bottom_right_neighbor(coarse_node[0] + 1, coarse_node[1]); + MultiIndex top_left_neighbor(coarse_node[0], (coarse_node[1] + 1) % coarseGrid.ntheta()); + result[index] = 0.5 * (x[coarseGrid.index(bottom_right_neighbor)] + x[coarseGrid.index(top_left_neighbor)]); + } + } +} + +// --------------------------------------- // +// Optimized version of applyProlongation0 // +// --------------------------------------- // + +#define FINE_NODE_EXTRAPOLATED_PROLONGATION() \ + do { \ + if (i_r & 1) { \ + if (i_theta & 1) { \ + /* i_r % 2 == 1, i_theta % 2 == 1 */ \ + /* Fine node in the center of four coarse nodes */ \ + result[fineGrid.index(i_r, i_theta)] = \ + 0.5 * (x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] + /* Bottom right */ \ + x[coarseGrid.index(i_r_coarse, i_theta_coarse + 1)] /* Top left */ \ + ); \ + } \ + else { \ + /* i_r % 2 == 1, i_theta % 2 == 0 */ \ + /* Fine node between coarse nodes in radial direction */ \ + result[fineGrid.index(i_r, i_theta)] = \ + 0.5 * (x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* left */ \ + x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] /* right */ \ + ); \ + } \ + } \ + else { \ + if (i_theta & 1) { \ + /* i_r % 2 == 0, i_theta % 2 == 1 */ \ + /* Fine node between coarse nodes in theta direction */ \ + result[fineGrid.index(i_r, i_theta)] = \ + 0.5 * (x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* bottom */ \ + x[coarseGrid.index(i_r_coarse, i_theta_coarse + 1)] /* top */ \ + ); \ + } \ + else { \ + /* i_r % 2 == 0, i_theta % 2 == 0 */ \ + /* Fine node appears in coarse grid */ \ + result[fineGrid.index(i_r, i_theta)] = x[coarseGrid.index(i_r_coarse, i_theta_coarse)]; /* center */ \ + } \ + } \ + } while (0) + +void Interpolation::applyExtrapolatedProlongation(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() - 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& coarseGrid = fromLevel.grid(); + const PolarGrid& fineGrid = toLevel.grid(); + + assert(x.size() == coarseGrid.numberOfNodes()); + assert(result.size() == fineGrid.numberOfNodes()); + +#pragma omp parallel if (fineGrid.numberOfNodes() > 10'000) + { +/* Circluar Indexing Section */ +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r = 0; i_r < fineGrid.numberSmootherCircles(); i_r++) { + int i_r_coarse = i_r / 2; + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + FINE_NODE_EXTRAPOLATED_PROLONGATION(); + } + } + +/* Radial Indexing Section */ +/* For loop matches radial access pattern */ +#pragma omp for nowait + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + for (int i_r = fineGrid.numberSmootherCircles(); i_r < fineGrid.nr(); i_r++) { + int i_r_coarse = i_r / 2; + FINE_NODE_EXTRAPOLATED_PROLONGATION(); + } + } + } +} diff --git a/src/Interpolation/extrapolated_restriction.cpp b/src/Interpolation/extrapolated_restriction.cpp new file mode 100644 index 00000000..46233858 --- /dev/null +++ b/src/Interpolation/extrapolated_restriction.cpp @@ -0,0 +1,172 @@ +#include "../../include/Interpolation/interpolation.h" + +/* For the restriction we use R_ex = P_ex^T */ + +void Interpolation::applyExtrapolatedRestriction0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + +#pragma omp parallel for + for (int index = 0; index < coarseGrid.numberOfNodes(); index++) { + MultiIndex coarse_node = coarseGrid.multiIndex(index); + MultiIndex fine_node(2 * coarse_node[0], 2 * coarse_node[1]); + + std::array, space_dimension> neighbors; + + // Center + double value = x[fineGrid.index(fine_node)]; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + // Left + if (neighbors[0].first != -1) { + value += 0.5 * x[neighbors[0].first]; + } + + // Right + if (neighbors[0].second != -1) { + value += 0.5 * x[neighbors[0].second]; + } + + // Bottom + if (neighbors[1].first != -1) { + value += 0.5 * x[neighbors[1].first]; + } + + // Top + if (neighbors[1].second != -1) { + value += 0.5 * x[neighbors[1].second]; + } + + fineGrid.diagonalNeighborsOf(fine_node, neighbors); + + // Bottom Right + if (neighbors[0].second != -1) { + value += 0.5 * x[neighbors[0].second]; + } + + // Top Left + if (neighbors[1].first != -1) { + value += 0.5 * x[neighbors[1].first]; + } + + result[index] = value; + } +} + +// -------------------------------------- // +// Optimized version of applyRestriction0 // +// -------------------------------------- // + +void Interpolation::applyExtrapolatedRestriction(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + + const int coarseNumberSmootherCircles = coarseGrid.numberSmootherCircles(); + +#pragma omp parallel if (fineGrid.numberOfNodes() > 10'000) + { +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r_coarse = 0; i_r_coarse < coarseNumberSmootherCircles; i_r_coarse++) { + int i_r = i_r_coarse * 2; + for (int i_theta_coarse = 0; i_theta_coarse < coarseGrid.ntheta(); i_theta_coarse++) { + int i_theta = i_theta_coarse * 2; + + if (0 < i_r_coarse && i_r_coarse < coarseNumberSmootherCircles - 1) { + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = + // Center + x[fineGrid.index(i_r, i_theta)] + + // Left, Right, Bottom, Top + 0.5 * x[fineGrid.index(i_r - 1, i_theta)] + 0.5 * x[fineGrid.index(i_r + 1, i_theta)] + + 0.5 * x[fineGrid.index(i_r, i_theta_M1)] + 0.5 * x[fineGrid.index(i_r, i_theta_P1)] + + // Bottom Right, Top Left + 0.5 * x[fineGrid.index(i_r + 1, i_theta_M1)] + 0.5 * x[fineGrid.index(i_r - 1, i_theta_P1)]; + } + else { + /* First and Last Circle have to be checked for domain boundary */ + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + // Center, Bottom, Top + double value = x[fineGrid.index(i_r, i_theta)] + 0.5 * x[fineGrid.index(i_r, i_theta_M1)] + + 0.5 * x[fineGrid.index(i_r, i_theta_P1)]; + + if (i_r_coarse > 0) { + // Left, Top Left + value += + 0.5 * x[fineGrid.index(i_r - 1, i_theta)] + 0.5 * x[fineGrid.index(i_r - 1, i_theta_P1)]; + } + if (i_r_coarse < coarseGrid.nr() - 1) { + // Right, Bottom Right + value += + 0.5 * x[fineGrid.index(i_r + 1, i_theta)] + 0.5 * x[fineGrid.index(i_r + 1, i_theta_M1)]; + } + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = value; + } + } + } + +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_theta_coarse = 0; i_theta_coarse < coarseGrid.ntheta(); i_theta_coarse++) { + int i_theta = i_theta_coarse * 2; + for (int i_r_coarse = coarseNumberSmootherCircles; i_r_coarse < coarseGrid.nr(); i_r_coarse++) { + int i_r = i_r_coarse * 2; + + if (coarseGrid.numberSmootherCircles() < i_r_coarse && i_r_coarse < coarseGrid.nr() - 1) { + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = + // Center + x[fineGrid.index(i_r, i_theta)] + + // Left, Right, Bottom, Top + 0.5 * x[fineGrid.index(i_r - 1, i_theta)] + 0.5 * x[fineGrid.index(i_r + 1, i_theta)] + + 0.5 * x[fineGrid.index(i_r, i_theta_M1)] + 0.5 * x[fineGrid.index(i_r, i_theta_P1)] + + // Bottom Right, Top Left + 0.5 * x[fineGrid.index(i_r + 1, i_theta_M1)] + 0.5 * x[fineGrid.index(i_r - 1, i_theta_P1)]; + } + else { + /* First and Last radial nodes have to be checked for domain boundary */ + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + // Center, Bottom, Top + double value = x[fineGrid.index(i_r, i_theta)] + 0.5 * x[fineGrid.index(i_r, i_theta_M1)] + + 0.5 * x[fineGrid.index(i_r, i_theta_P1)]; + if (i_r_coarse > 0) { + // Left, Top Left + value += + 0.5 * x[fineGrid.index(i_r - 1, i_theta)] + 0.5 * x[fineGrid.index(i_r - 1, i_theta_P1)]; + } + if (i_r_coarse < coarseGrid.nr() - 1) { + // Right, Bottom Right + value += + 0.5 * x[fineGrid.index(i_r + 1, i_theta)] + 0.5 * x[fineGrid.index(i_r + 1, i_theta_M1)]; + } + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = value; + } + } + } + } +} diff --git a/src/Interpolation/fmg_interpolation.cpp b/src/Interpolation/fmg_interpolation.cpp new file mode 100644 index 00000000..461fae64 --- /dev/null +++ b/src/Interpolation/fmg_interpolation.cpp @@ -0,0 +1,256 @@ +#include "../../include/Interpolation/interpolation.h" + +/* + * Bicubic FMG Interpolator Using Lagrange Polynomial + * ---------------------------------------------------- + * This implementation computes an interpolated value using a bicubic Full Multigrid (FMG) + * scheme. The interpolator applies a scaling factor of 1/16 with the coefficient vector [-1, 9, 9, -1]. + * + * The method uses Lagrange interpolation with 4 coarse grid nodes to calculate a single interpolated value. + * Nodes with an X are the 4 coarse interpolation points used for the interpolation. + * The node marked with an O is the interpolated value which we aim to obtain. + * + * | | | | + * | | | | + * v v v v + * X ---------h0-------- X ---h1--- O ---h2--- X ---------h3-------- X + * ^ + * | + * | + * Lagrange Interpolation: + * ----------------------- + * The interpolated value y is determined by forming a weighted sum of the function values: + * + * y = w0 * f0 + w1 * f1 + w2 * f2 + w3 * f3 + * + * Each weight w_i is calculated using the Lagrange interpolation formula. For example: + * + * w0 = ((z - x1) / (x0 - x1)) * ((z - x2) / (x0 - x2)) * ((z - x3) / (x0 - x3)) + * + * Similar expressions are used to compute weights w1, w2, and w3, where each weight excludes its corresponding node + * from the product. + * + * First, the interpolation is performed along the angular direction. Thanks to the periodic boundary conditions, + * no additional linear interpolation is required near the edges. In the subsequent step, the angular interpolation + * results are further refined through radial interpolation to produce the final interpolated value. + * + * Step 1: Interpolate the 4 fine nodes marked with an O. + * Step 2: Interpolate the node Z using the results from Step 1. + * + * X X X X + * + * + * + * X X X X + * + * O O Z O O + * + * X X X X + * + * + * + * X X X X + * + */ + +#define FINE_NODE_FMG_INTERPOLATION() \ + do { \ + /* Case 1: On the boundary */ \ + if (i_r == 0 || i_r == fineGrid.nr() - 1) { \ + if (i_theta & 1) { \ + double k0 = coarseGrid.angularSpacing(i_theta_coarse - 1); \ + double k1 = fineGrid.angularSpacing(i_theta - 1); \ + double k2 = fineGrid.angularSpacing(i_theta); \ + double k3 = coarseGrid.angularSpacing(i_theta_coarse + 1); \ + \ + double w_theta0 = -k1 / k0 * k2 / (k0 + k1 + k2) * (k2 + k3) / (k0 + k1 + k2 + k3); \ + double w_theta1 = (k0 + k1) / k0 * k2 / (k1 + k2) * (k2 + k3) / (k1 + k2 + k3); \ + double w_theta2 = (k0 + k1) / (k0 + k1 + k2) * k1 / (k1 + k2) * (k2 + k3) / k3; \ + double w_theta3 = -(k0 + k1) / (k0 + k1 + k2 + k3) * k1 / (k1 + k2 + k3) * k2 / k3; \ + \ + result[fineGrid.index(i_r, i_theta)] = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse, i_theta_coarse - 1)] + /* (0, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* (0, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 1)] + /* (0, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 2)] /* (0, +3) */ \ + ); \ + } \ + else { \ + result[fineGrid.index(i_r, i_theta)] = x[coarseGrid.index(i_r_coarse, i_theta_coarse)]; /* center */ \ + } \ + } \ + /* Case 2: Next to the boundary */ \ + else if (i_r == 1 || i_r == fineGrid.nr() - 2) { \ + if (i_theta & 1) { \ + double k0 = coarseGrid.angularSpacing(i_theta_coarse - 1); \ + double k1 = fineGrid.angularSpacing(i_theta - 1); \ + double k2 = fineGrid.angularSpacing(i_theta); \ + double k3 = coarseGrid.angularSpacing(i_theta_coarse + 1); \ + \ + double w_theta0 = -k1 / k0 * k2 / (k0 + k1 + k2) * (k2 + k3) / (k0 + k1 + k2 + k3); \ + double w_theta1 = (k0 + k1) / k0 * k2 / (k1 + k2) * (k2 + k3) / (k1 + k2 + k3); \ + double w_theta2 = (k0 + k1) / (k0 + k1 + k2) * k1 / (k1 + k2) * (k2 + k3) / k3; \ + double w_theta3 = -(k0 + k1) / (k0 + k1 + k2 + k3) * k1 / (k1 + k2 + k3) * k2 / k3; \ + \ + double left_value = (w_theta0 * x[coarseGrid.index(i_r_coarse, i_theta_coarse - 1)] + /* (-1, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* (-1, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 1)] + /* (-1, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 2)] /* (-1, +3) */ \ + ); \ + double right_value = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse - 1)] + /* (+1, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] + /* (+1, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse + 1)] + /* (+1, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse + 2)] /* (+1, +3) */ \ + ); \ + \ + double h1 = fineGrid.radialSpacing(i_r - 1); \ + double h2 = fineGrid.radialSpacing(i_r); \ + result[fineGrid.index(i_r, i_theta)] = (h1 * left_value + h2 * right_value) / (h1 + h2); \ + } \ + else { \ + double h1 = fineGrid.radialSpacing(i_r - 1); \ + double h2 = fineGrid.radialSpacing(i_r); \ + result[fineGrid.index(i_r, i_theta)] = \ + (h1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* left */ \ + h2 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] /* right */ \ + ) / \ + (h1 + h2); \ + } \ + } \ + else { \ + /* Case 3: In the interior */ \ + if (i_r & 1) { \ + if (i_theta & 1) { \ + double k0 = coarseGrid.angularSpacing(i_theta_coarse - 1); \ + double k1 = fineGrid.angularSpacing(i_theta - 1); \ + double k2 = fineGrid.angularSpacing(i_theta); \ + double k3 = coarseGrid.angularSpacing(i_theta_coarse + 1); \ + \ + double w_theta0 = -k1 / k0 * k2 / (k0 + k1 + k2) * (k2 + k3) / (k0 + k1 + k2 + k3); \ + double w_theta1 = (k0 + k1) / k0 * k2 / (k1 + k2) * (k2 + k3) / (k1 + k2 + k3); \ + double w_theta2 = (k0 + k1) / (k0 + k1 + k2) * k1 / (k1 + k2) * (k2 + k3) / k3; \ + double w_theta3 = -(k0 + k1) / (k0 + k1 + k2 + k3) * k1 / (k1 + k2 + k3) * k2 / k3; \ + \ + double outer_left_value = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse - 1, i_theta_coarse - 1)] + /* (-3, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse - 1, i_theta_coarse)] + /* (-3, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse - 1, i_theta_coarse + 1)] + /* (-3, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse - 1, i_theta_coarse + 2)] /* (-3, +3) */ \ + ); \ + double inner_left_value = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse, i_theta_coarse - 1)] + /* (-1, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* (-1, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 1)] + /* (-1, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 2)] /* (-1, +3) */ \ + ); \ + double inner_right_value = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse - 1)] + /* (+1, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] + /* (+1, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse + 1)] + /* (+1, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse + 2)] /* (+1, +3) */ \ + ); \ + double outer_right_value = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse + 2, i_theta_coarse - 1)] + /* (+3, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse + 2, i_theta_coarse)] + /* (+3, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse + 2, i_theta_coarse + 1)] + /* (+3, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse + 2, i_theta_coarse + 2)] /* (+3, +3) */ \ + ); \ + \ + double h0 = coarseGrid.radialSpacing(i_r_coarse - 1); \ + double h1 = fineGrid.radialSpacing(i_r - 1); \ + double h2 = fineGrid.radialSpacing(i_r); \ + double h3 = coarseGrid.radialSpacing(i_r_coarse + 1); \ + \ + double w_r0 = -h1 / h0 * h2 / (h0 + h1 + h2) * (h2 + h3) / (h0 + h1 + h2 + h3); \ + double w_r1 = (h0 + h1) / h0 * h2 / (h1 + h2) * (h2 + h3) / (h1 + h2 + h3); \ + double w_r2 = (h0 + h1) / (h0 + h1 + h2) * h1 / (h1 + h2) * (h2 + h3) / h3; \ + double w_r3 = -(h0 + h1) / (h0 + h1 + h2 + h3) * h1 / (h1 + h2 + h3) * h2 / h3; \ + \ + result[fineGrid.index(i_r, i_theta)] = (w_r0 * outer_left_value + w_r1 * inner_left_value + \ + w_r2 * inner_right_value + w_r3 * outer_right_value); \ + } \ + else { \ + double h0 = coarseGrid.radialSpacing(i_r_coarse - 1); \ + double h1 = fineGrid.radialSpacing(i_r - 1); \ + double h2 = fineGrid.radialSpacing(i_r); \ + double h3 = coarseGrid.radialSpacing(i_r_coarse + 1); \ + \ + double w_r0 = -h1 / h0 * h2 / (h0 + h1 + h2) * (h2 + h3) / (h0 + h1 + h2 + h3); \ + double w_r1 = (h0 + h1) / h0 * h2 / (h1 + h2) * (h2 + h3) / (h1 + h2 + h3); \ + double w_r2 = (h0 + h1) / (h0 + h1 + h2) * h1 / (h1 + h2) * (h2 + h3) / h3; \ + double w_r3 = -(h0 + h1) / (h0 + h1 + h2 + h3) * h1 / (h1 + h2 + h3) * h2 / h3; \ + \ + result[fineGrid.index(i_r, i_theta)] = \ + (w_r0 * x[coarseGrid.index(i_r_coarse - 1, i_theta_coarse)] + /* (-3, 0) */ \ + w_r1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* (-1, 0) */ \ + w_r2 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] + /* (+1, 0) */ \ + w_r3 * x[coarseGrid.index(i_r_coarse + 2, i_theta_coarse)] /* (+3, 0) */ \ + ); \ + } \ + } \ + else { \ + if (i_theta & 1) { \ + double k0 = coarseGrid.angularSpacing(i_theta_coarse - 1); \ + double k1 = fineGrid.angularSpacing(i_theta - 1); \ + double k2 = fineGrid.angularSpacing(i_theta); \ + double k3 = coarseGrid.angularSpacing(i_theta_coarse + 1); \ + \ + double w_theta0 = -k1 / k0 * k2 / (k0 + k1 + k2) * (k2 + k3) / (k0 + k1 + k2 + k3); \ + double w_theta1 = (k0 + k1) / k0 * k2 / (k1 + k2) * (k2 + k3) / (k1 + k2 + k3); \ + double w_theta2 = (k0 + k1) / (k0 + k1 + k2) * k1 / (k1 + k2) * (k2 + k3) / k3; \ + double w_theta3 = -(k0 + k1) / (k0 + k1 + k2 + k3) * k1 / (k1 + k2 + k3) * k2 / k3; \ + \ + result[fineGrid.index(i_r, i_theta)] = \ + (w_theta0 * x[coarseGrid.index(i_r_coarse, i_theta_coarse - 1)] + /* (0, -3) */ \ + w_theta1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* (0, -1) */ \ + w_theta2 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 1)] + /* (0, +1) */ \ + w_theta3 * x[coarseGrid.index(i_r_coarse, i_theta_coarse + 2)] /* (0, +3) */ \ + ); \ + } \ + else { \ + result[fineGrid.index(i_r, i_theta)] = \ + x[coarseGrid.index(i_r_coarse, i_theta_coarse)]; /* center */ \ + } \ + } \ + } \ + } while (0) + +void Interpolation::applyFMGInterpolation(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() - 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& coarseGrid = fromLevel.grid(); + const PolarGrid& fineGrid = toLevel.grid(); + + assert(x.size() == coarseGrid.numberOfNodes()); + assert(result.size() == fineGrid.numberOfNodes()); + +#pragma omp parallel if (fineGrid.numberOfNodes() > 10'000) + { +/* Circluar Indexing Section */ +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r = 0; i_r < fineGrid.numberSmootherCircles(); i_r++) { + int i_r_coarse = i_r / 2; + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + FINE_NODE_FMG_INTERPOLATION(); + } + } + +/* Radial Indexing Section */ +/* For loop matches radial access pattern */ +#pragma omp for nowait + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + for (int i_r = fineGrid.numberSmootherCircles(); i_r < fineGrid.nr(); i_r++) { + int i_r_coarse = i_r / 2; + FINE_NODE_FMG_INTERPOLATION(); + } + } + } +} diff --git a/src/Interpolation/injection.cpp b/src/Interpolation/injection.cpp new file mode 100644 index 00000000..6495891f --- /dev/null +++ b/src/Interpolation/injection.cpp @@ -0,0 +1,40 @@ +#include "../../include/Interpolation/interpolation.h" + +/* Remark: This injection is not scaled. */ + +void Interpolation::applyInjection(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + +#pragma omp parallel if (fineGrid.numberOfNodes() > 10'000) + { +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r_coarse = 0; i_r_coarse < coarseGrid.numberSmootherCircles(); i_r_coarse++) { + int i_r = i_r_coarse * 2; + for (int i_theta_coarse = 0; i_theta_coarse < coarseGrid.ntheta(); i_theta_coarse++) { + int i_theta = i_theta_coarse * 2; + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = x[fineGrid.index(i_r, i_theta)]; + } + } + +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_theta_coarse = 0; i_theta_coarse < coarseGrid.ntheta(); i_theta_coarse++) { + int i_theta = i_theta_coarse * 2; + for (int i_r_coarse = coarseGrid.numberSmootherCircles(); i_r_coarse < coarseGrid.nr(); i_r_coarse++) { + int i_r = i_r_coarse * 2; + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = x[fineGrid.index(i_r, i_theta)]; + } + } + } +} diff --git a/src/Interpolation/interpolation.cpp b/src/Interpolation/interpolation.cpp new file mode 100644 index 00000000..64d1bbe0 --- /dev/null +++ b/src/Interpolation/interpolation.cpp @@ -0,0 +1,7 @@ +#include "../../include/Interpolation/interpolation.h" + +Interpolation::Interpolation(const std::vector& threads_per_level, const bool DirBC_Interior) + : threads_per_level_(threads_per_level) + , DirBC_Interior_(DirBC_Interior) +{ +} \ No newline at end of file diff --git a/src/Interpolation/prolongation.cpp b/src/Interpolation/prolongation.cpp new file mode 100644 index 00000000..335604a8 --- /dev/null +++ b/src/Interpolation/prolongation.cpp @@ -0,0 +1,192 @@ +#include "../../include/Interpolation/interpolation.h" + +// We use the anisotropic bilinear interpolation stencil. +// For an isotropic mesh, this stencil reduces to +// |1 2 1| +// P = 1/4 * |2 4 2| +// |1 2 1| + +void Interpolation::applyProlongation0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() - 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& coarseGrid = fromLevel.grid(); + const PolarGrid& fineGrid = toLevel.grid(); + + assert(x.size() == coarseGrid.numberOfNodes()); + assert(result.size() == fineGrid.numberOfNodes()); + +#pragma omp parallel for + for (int index = 0; index < fineGrid.numberOfNodes(); index++) { + std::array, space_dimension> neighbor_distance; + + MultiIndex fine_node = fineGrid.multiIndex(index); + MultiIndex coarse_node(fine_node[0] / 2, fine_node[1] / 2); // Nearest lower left coarse node in the fine grid. + + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 0) { + // Fine node appears in coarse grid + result[index] = x[coarseGrid.index(coarse_node)]; + } + + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 1) { + // Fine node between two coarse nodes in theta direction + // X + // | + // O + // | + // X + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + + double k1 = neighbor_distance[1].first; + double k2 = neighbor_distance[1].second; + + MultiIndex bottomNeighbor(coarse_node[0], coarse_node[1]); + MultiIndex topNeighbor(coarse_node[0], (coarse_node[1] + 1) % coarseGrid.ntheta()); + + result[index] = + (k1 * x[coarseGrid.index(bottomNeighbor)] + k2 * x[coarseGrid.index(topNeighbor)]) / (k1 + k2); + } + + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 0) { + // Fine node between two coarse nodes in radial direction + // X -- O -- X + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + + double h1 = neighbor_distance[0].first; + double h2 = neighbor_distance[0].second; + + MultiIndex leftNeighbor(coarse_node[0], coarse_node[1]); + MultiIndex rightNeighbor(coarse_node[0] + 1, coarse_node[1]); + + result[index] = + (h1 * x[coarseGrid.index(leftNeighbor)] + h2 * x[coarseGrid.index(rightNeighbor)]) / (h1 + h2); + } + + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 1) { + // Interpolates a fine node value based on four neighboring coarse nodes. + // Fine node lies in the center of four coarse nodes forming a cross shape: + // + // X X + /* \ / */ + // O <-- Fine Node (i_r, i_theta) + /* / \ */ + // X X + // + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + + double h1 = neighbor_distance[0].first; + double h2 = neighbor_distance[0].second; + double k1 = neighbor_distance[1].first; + double k2 = neighbor_distance[1].second; + + MultiIndex bottom_left_neighbor(coarse_node[0], coarse_node[1]); + MultiIndex bottom_right_neighbor(coarse_node[0] + 1, coarse_node[1]); + MultiIndex top_left_neighbor(coarse_node[0], (coarse_node[1] + 1) % coarseGrid.ntheta()); + MultiIndex top_right_neighbor(coarse_node[0] + 1, (coarse_node[1] + 1) % coarseGrid.ntheta()); + + result[index] = + (h1 * k1 * x[coarseGrid.index(bottom_left_neighbor)] + + h2 * k1 * x[coarseGrid.index(bottom_right_neighbor)] + + h1 * k2 * x[coarseGrid.index(top_left_neighbor)] + h2 * k2 * x[coarseGrid.index(top_right_neighbor)]) / + ((h1 + h2) * (k1 + k2)); + } + } +} + +// --------------------------------------- // +// Optimized version of applyProlongation0 // +// --------------------------------------- // + +#define FINE_NODE_PROLONGATION() \ + do { \ + if (i_r & 1) { \ + if (i_theta & 1) { \ + /* i_r % 2 == 1, i_theta % 2 == 1 */ \ + /* Fine node in the center of four coarse nodes */ \ + double h1 = fineGrid.radialSpacing(i_r - 1); \ + double h2 = fineGrid.radialSpacing(i_r); \ + double k1 = fineGrid.angularSpacing(i_theta - 1); \ + double k2 = fineGrid.angularSpacing(i_theta); \ + int i_theta_coarse_P1 = coarseGrid.wrapThetaIndex(i_theta_coarse + 1); \ + double divisor = (h1 + h2) * (k1 + k2); \ + double value = (h1 * k1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* Bottom left */ \ + h2 * k1 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] + /* Bottom right */ \ + h1 * k2 * x[coarseGrid.index(i_r_coarse, i_theta_coarse_P1)] + /* Top left */ \ + h2 * k2 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse_P1)] /* Top right */ \ + ); \ + result[fineGrid.index(i_r, i_theta)] = value / divisor; \ + } \ + else { \ + /* i_r % 2 == 1, i_theta % 2 == 0 */ \ + /* Fine node between coarse nodes in radial direction */ \ + double h1 = fineGrid.radialSpacing(i_r - 1); \ + double h2 = fineGrid.radialSpacing(i_r); \ + double divisor = (h1 + h2); \ + double value = (h1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* left */ \ + h2 * x[coarseGrid.index(i_r_coarse + 1, i_theta_coarse)] /* right */ \ + ); \ + result[fineGrid.index(i_r, i_theta)] = value / divisor; \ + } \ + } \ + else { \ + if (i_theta & 1) { \ + /* i_r % 2 == 0, i_theta % 2 == 1 */ \ + /* Fine node between coarse nodes in theta direction */ \ + double k1 = fineGrid.angularSpacing(i_theta - 1); \ + double k2 = fineGrid.angularSpacing(i_theta); \ + int i_theta_coarse_P1 = coarseGrid.wrapThetaIndex(i_theta_coarse + 1); \ + double divisor = (k1 + k2); \ + double value = (k1 * x[coarseGrid.index(i_r_coarse, i_theta_coarse)] + /* bottom */ \ + k2 * x[coarseGrid.index(i_r_coarse, i_theta_coarse_P1)] /* top */ \ + ); \ + result[fineGrid.index(i_r, i_theta)] = value / divisor; \ + } \ + else { \ + /* i_r % 2 == 0, i_theta % 2 == 0 */ \ + /* Fine node appears in coarse grid */ \ + result[fineGrid.index(i_r, i_theta)] = x[coarseGrid.index(i_r_coarse, i_theta_coarse)]; /* center */ \ + } \ + } \ + } while (0) + +void Interpolation::applyProlongation(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() - 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& coarseGrid = fromLevel.grid(); + const PolarGrid& fineGrid = toLevel.grid(); + + assert(x.size() == coarseGrid.numberOfNodes()); + assert(result.size() == fineGrid.numberOfNodes()); + +#pragma omp parallel if (fineGrid.numberOfNodes() > 10'000) + { +/* Circluar Indexing Section */ +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r = 0; i_r < fineGrid.numberSmootherCircles(); i_r++) { + int i_r_coarse = i_r / 2; + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + FINE_NODE_PROLONGATION(); + } + } + +/* Radial Indexing Section */ +/* For loop matches radial access pattern */ +#pragma omp for nowait + for (int i_theta = 0; i_theta < fineGrid.ntheta(); i_theta++) { + int i_theta_coarse = i_theta / 2; + for (int i_r = fineGrid.numberSmootherCircles(); i_r < fineGrid.nr(); i_r++) { + int i_r_coarse = i_r / 2; + FINE_NODE_PROLONGATION(); + } + } + } +} diff --git a/src/Interpolation/restriction.cpp b/src/Interpolation/restriction.cpp new file mode 100644 index 00000000..a7c9c887 --- /dev/null +++ b/src/Interpolation/restriction.cpp @@ -0,0 +1,269 @@ +#include "../../include/Interpolation/interpolation.h" + +// For the restriction we use R = P^T. +// The restriction for an siotropic mesh reduces to +// |1 2 1| +// R = 1/4 * |2 4 2| = P^T +// |1 2 1| + +void Interpolation::applyRestriction0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + +#pragma omp parallel for + for (int index = 0; index < coarseGrid.numberOfNodes(); index++) { + MultiIndex coarse_node = coarseGrid.multiIndex(index); + MultiIndex fine_node(2 * coarse_node[0], 2 * coarse_node[1]); + + std::array, space_dimension> neighbor_distance; + std::array, space_dimension> neighbors; + + // Center + double value = x[fineGrid.index(fine_node)]; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + // Left + if (neighbors[0].first != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[0].first), neighbor_distance); + value += neighbor_distance[0].second * x[neighbors[0].first] / + (neighbor_distance[0].first + neighbor_distance[0].second); + } + + // Right + if (neighbors[0].second != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[0].second), neighbor_distance); + value += neighbor_distance[0].first * x[neighbors[0].second] / + (neighbor_distance[0].first + neighbor_distance[0].second); + } + + // Bottom + if (neighbors[1].first != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[1].first), neighbor_distance); + value += neighbor_distance[1].second * x[neighbors[1].first] / + (neighbor_distance[1].first + neighbor_distance[1].second); + } + + // Top + if (neighbors[1].second != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[1].second), neighbor_distance); + value += neighbor_distance[1].first * x[neighbors[1].second] / + (neighbor_distance[1].first + neighbor_distance[1].second); + } + + fineGrid.diagonalNeighborsOf(fine_node, neighbors); + + // Bottom Left + if (neighbors[0].first != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[0].first), neighbor_distance); + value += neighbor_distance[0].second * neighbor_distance[1].second * x[neighbors[0].first] / + ((neighbor_distance[0].first + neighbor_distance[0].second) * + (neighbor_distance[1].first + neighbor_distance[1].second)); + } + + // Bottom Right + if (neighbors[0].second != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[0].second), neighbor_distance); + value += neighbor_distance[0].first * neighbor_distance[1].second * x[neighbors[0].second] / + ((neighbor_distance[0].first + neighbor_distance[0].second) * + (neighbor_distance[1].first + neighbor_distance[1].second)); + } + + // Top Left + if (neighbors[1].first != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[1].first), neighbor_distance); + value += neighbor_distance[0].second * neighbor_distance[1].first * x[neighbors[1].first] / + ((neighbor_distance[0].first + neighbor_distance[0].second) * + (neighbor_distance[1].first + neighbor_distance[1].second)); + } + + // Top Right + if (neighbors[1].second != -1) { + fineGrid.adjacentNeighborDistances(fineGrid.multiIndex(neighbors[1].second), neighbor_distance); + value += neighbor_distance[0].first * neighbor_distance[1].first * x[neighbors[1].second] / + ((neighbor_distance[0].first + neighbor_distance[0].second) * + (neighbor_distance[1].first + neighbor_distance[1].second)); + } + + result[index] = value; + } +} + +// -------------------------------------- // +// Optimized version of applyRestriction0 // +// -------------------------------------- // + +void Interpolation::applyRestriction(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) const +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + omp_set_num_threads(threads_per_level_[toLevel.level_depth()]); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + + const int coarseNumberSmootherCircles = coarseGrid.numberSmootherCircles(); + +#pragma omp parallel if (fineGrid.numberOfNodes() > 10'000) + { +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_r_coarse = 0; i_r_coarse < coarseNumberSmootherCircles; i_r_coarse++) { + int i_r = i_r_coarse * 2; + for (int i_theta_coarse = 0; i_theta_coarse < coarseGrid.ntheta(); i_theta_coarse++) { + int i_theta = i_theta_coarse * 2; + + if (0 < i_r_coarse && i_r_coarse < coarseNumberSmootherCircles - 1) { + double h1 = fineGrid.radialSpacing(i_r - 2); + double h2 = fineGrid.radialSpacing(i_r - 1); + double h3 = fineGrid.radialSpacing(i_r); + double h4 = fineGrid.radialSpacing(i_r + 1); + + int i_theta_M2 = fineGrid.wrapThetaIndex(i_theta - 2); + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + + double k1 = fineGrid.angularSpacing(i_theta_M2); + double k2 = fineGrid.angularSpacing(i_theta_M1); + double k3 = fineGrid.angularSpacing(i_theta); + double k4 = fineGrid.angularSpacing(i_theta_P1); + + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = + // Center + x[fineGrid.index(i_r, i_theta)] + + // Left, Right, Bottom, Top + h2 * x[fineGrid.index(i_r - 1, i_theta)] / (h1 + h2) + + h3 * x[fineGrid.index(i_r + 1, i_theta)] / (h3 + h4) + + k2 * x[fineGrid.index(i_r, i_theta_M1)] / (k1 + k2) + + k3 * x[fineGrid.index(i_r, i_theta_P1)] / (k3 + k4) + + // Bottom Left, Bottom Right, Top Left, Top Right + h2 * k2 * x[fineGrid.index(i_r - 1, i_theta_M1)] / ((h1 + h2) * (k1 + k2)) + + h3 * k2 * x[fineGrid.index(i_r + 1, i_theta_M1)] / ((h3 + h4) * (k1 + k2)) + + h2 * k3 * x[fineGrid.index(i_r - 1, i_theta_P1)] / ((h1 + h2) * (k3 + k4)) + + h3 * k3 * x[fineGrid.index(i_r + 1, i_theta_P1)] / ((h3 + h4) * (k3 + k4)); + } + else { + /* First and Last Circle have to be checked for domain boundary */ + // Middle Part + int i_theta_M2 = fineGrid.wrapThetaIndex(i_theta - 2); + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + double k1 = fineGrid.angularSpacing(i_theta_M2); + double k2 = fineGrid.angularSpacing(i_theta_M1); + double k3 = fineGrid.angularSpacing(i_theta); + double k4 = fineGrid.angularSpacing(i_theta_P1); + // Center, Bottom, Top + double value = x[fineGrid.index(i_r, i_theta)] + + k2 * x[fineGrid.index(i_r, i_theta_M1)] / (k1 + k2) + + k3 * x[fineGrid.index(i_r, i_theta_P1)] / (k3 + k4); + + if (i_r_coarse > 0) { + // Left Part + double h1 = fineGrid.radialSpacing(i_r - 2); + double h2 = fineGrid.radialSpacing(i_r - 1); + // Left, Bottom Left, Top Left + value += h2 * x[fineGrid.index(i_r - 1, i_theta)] / (h1 + h2) + + h2 * k2 * x[fineGrid.index(i_r - 1, i_theta_M1)] / ((h1 + h2) * (k1 + k2)) + + h2 * k3 * x[fineGrid.index(i_r - 1, i_theta_P1)] / ((h1 + h2) * (k3 + k4)); + } + if (i_r_coarse < coarseGrid.nr() - 1) { + // Right Part + double h3 = fineGrid.radialSpacing(i_r); + double h4 = fineGrid.radialSpacing(i_r + 1); + // Right, Bottom Right, Top Right + value += h3 * x[fineGrid.index(i_r + 1, i_theta)] / (h3 + h4) + + h3 * k2 * x[fineGrid.index(i_r + 1, i_theta_M1)] / ((h3 + h4) * (k1 + k2)) + + h3 * k3 * x[fineGrid.index(i_r + 1, i_theta_P1)] / ((h3 + h4) * (k3 + k4)); + } + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = value; + } + } + } + +/* For loop matches circular access pattern */ +#pragma omp for nowait + for (int i_theta_coarse = 0; i_theta_coarse < coarseGrid.ntheta(); i_theta_coarse++) { + int i_theta = i_theta_coarse * 2; + for (int i_r_coarse = coarseNumberSmootherCircles; i_r_coarse < coarseGrid.nr(); i_r_coarse++) { + int i_r = i_r_coarse * 2; + + if (coarseGrid.numberSmootherCircles() < i_r_coarse && i_r_coarse < coarseGrid.nr() - 1) { + double h1 = fineGrid.radialSpacing(i_r - 2); + double h2 = fineGrid.radialSpacing(i_r - 1); + double h3 = fineGrid.radialSpacing(i_r); + double h4 = fineGrid.radialSpacing(i_r + 1); + + int i_theta_M2 = fineGrid.wrapThetaIndex(i_theta - 2); + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + double k1 = fineGrid.angularSpacing(i_theta_M2); + double k2 = fineGrid.angularSpacing(i_theta_M1); + double k3 = fineGrid.angularSpacing(i_theta); + double k4 = fineGrid.angularSpacing(i_theta_P1); + + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = + // Center + x[fineGrid.index(i_r, i_theta)] + + // Left, Right, Bottom, Top + h2 * x[fineGrid.index(i_r - 1, i_theta)] / (h1 + h2) + + h3 * x[fineGrid.index(i_r + 1, i_theta)] / (h3 + h4) + + k2 * x[fineGrid.index(i_r, i_theta_M1)] / (k1 + k2) + + k3 * x[fineGrid.index(i_r, i_theta_P1)] / (k3 + k4) + + // Bottom Left, Bottom Right, Top Left, Top Right + h2 * k2 * x[fineGrid.index(i_r - 1, i_theta_M1)] / ((h1 + h2) * (k1 + k2)) + + h3 * k2 * x[fineGrid.index(i_r + 1, i_theta_M1)] / ((h3 + h4) * (k1 + k2)) + + h2 * k3 * x[fineGrid.index(i_r - 1, i_theta_P1)] / ((h1 + h2) * (k3 + k4)) + + h3 * k3 * x[fineGrid.index(i_r + 1, i_theta_P1)] / ((h3 + h4) * (k3 + k4)); + } + else { + /* First and Last radial nodes have to be checked for domain boundary */ + // Middle Part + int i_theta_M2 = fineGrid.wrapThetaIndex(i_theta - 2); + int i_theta_M1 = fineGrid.wrapThetaIndex(i_theta - 1); + int i_theta_P1 = fineGrid.wrapThetaIndex(i_theta + 1); + double k1 = fineGrid.angularSpacing(i_theta_M2); + double k2 = fineGrid.angularSpacing(i_theta_M1); + double k3 = fineGrid.angularSpacing(i_theta); + double k4 = fineGrid.angularSpacing(i_theta_P1); + // Center, Bottom, Top + double value = x[fineGrid.index(i_r, i_theta)] + + k2 * x[fineGrid.index(i_r, i_theta_M1)] / (k1 + k2) + + k3 * x[fineGrid.index(i_r, i_theta_P1)] / (k3 + k4); + if (i_r_coarse > 0) { + // Left Part + double h1 = fineGrid.radialSpacing(i_r - 2); + double h2 = fineGrid.radialSpacing(i_r - 1); + // Left, Bottom Left, Top Left + value += h2 * x[fineGrid.index(i_r - 1, i_theta)] / (h1 + h2) + + h2 * k2 * x[fineGrid.index(i_r - 1, i_theta_M1)] / ((h1 + h2) * (k1 + k2)) + + h2 * k3 * x[fineGrid.index(i_r - 1, i_theta_P1)] / ((h1 + h2) * (k3 + k4)); + } + if (i_r_coarse < coarseGrid.nr() - 1) { + // Right Part + double h3 = fineGrid.radialSpacing(i_r); + double h4 = fineGrid.radialSpacing(i_r + 1); + // Right, Bottom Right, Top Right + value += h3 * x[fineGrid.index(i_r + 1, i_theta)] / (h3 + h4) + + h3 * k2 * x[fineGrid.index(i_r + 1, i_theta_M1)] / ((h3 + h4) * (k1 + k2)) + + h3 * k3 * x[fineGrid.index(i_r + 1, i_theta_P1)] / ((h3 + h4) * (k3 + k4)); + } + result[coarseGrid.index(i_r_coarse, i_theta_coarse)] = value; + } + } + } + } +} +//clang-format on \ No newline at end of file diff --git a/src/Level/level.cpp b/src/Level/level.cpp new file mode 100644 index 00000000..81853dd5 --- /dev/null +++ b/src/Level/level.cpp @@ -0,0 +1,193 @@ +#include "../../include/Level/level.h" + +#include "../../include/Residual/ResidualGive/residualGive.h" +#include "../../include/Residual/ResidualTake/residualTake.h" + +#include "../../include/DirectSolver/DirectSolverGive/directSolverGive.h" +#include "../../include/DirectSolver/DirectSolverTake/directSolverTake.h" +#include "../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" +#include "../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" + +#include "../../include/Smoother/SmootherGive/smootherGive.h" +#include "../../include/Smoother/SmootherTake/smootherTake.h" + +#include "../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" +#include "../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +// ----------- // +// Constructor // +Level::Level(const int level_depth, std::unique_ptr grid, + std::unique_ptr level_cache, const ExtrapolationType extrapolation, const bool FMG) + : level_depth_(level_depth) + , grid_(std::move(grid)) + , level_cache_(std::move(level_cache)) + , rhs_((FMG || level_depth == 0 || (level_depth == 1 && extrapolation != ExtrapolationType::NONE)) + ? grid_->numberOfNodes() + : 0) + , solution_(grid_->numberOfNodes()) + , residual_(grid_->numberOfNodes()) + , error_correction_((level_depth > 0) ? grid_->numberOfNodes() : 0) +{ +} + +// ---------------- // +// Getter Functions // +int Level::level_depth() const +{ + return level_depth_; +} + +const PolarGrid& Level::grid() const +{ + return *grid_; +} + +const LevelCache& Level::levelCache() const +{ + return *level_cache_; +} + +Vector& Level::rhs() +{ + return rhs_; +} +const Vector& Level::rhs() const +{ + return rhs_; +} +Vector& Level::solution() +{ + return solution_; +} +const Vector& Level::solution() const +{ + return solution_; +} +Vector& Level::residual() +{ + return residual_; +} +const Vector& Level::residual() const +{ + return residual_; +} +Vector& Level::error_correction() +{ + return error_correction_; +} +const Vector& Level::error_correction() const +{ + return error_correction_; +} + +// -------------- // +// Apply Residual // +void Level::initializeResidual(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads, + const StencilDistributionMethod stencil_distribution_method) +{ + if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { + op_residual_ = std::make_unique(*grid_, *level_cache_, domain_geometry, + density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { + op_residual_ = std::make_unique(*grid_, *level_cache_, domain_geometry, + density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + if (!op_residual_) + throw std::runtime_error("Failed to initialize Residual."); +} +void Level::computeResidual(Vector& result, const Vector& rhs, const Vector& x) const +{ + if (!op_residual_) + throw std::runtime_error("Residual not initialized."); + op_residual_->computeResidual(result, rhs, x); +} + +// ------------------- // +// Solve coarse System // +void Level::initializeDirectSolver(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads, + const StencilDistributionMethod stencil_distribution_method) +{ +#ifdef GMGPOLAR_USE_MUMPS + if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { + op_directSolver_ = std::make_unique( + *grid_, *level_cache_, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { + op_directSolver_ = std::make_unique( + *grid_, *level_cache_, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads); + } +#else + if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { + op_directSolver_ = std::make_unique( + *grid_, *level_cache_, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { + op_directSolver_ = std::make_unique( + *grid_, *level_cache_, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads); + } +#endif + if (!op_directSolver_) + throw std::runtime_error("Failed to initialize Direct Solver."); +} + +void Level::directSolveInPlace(Vector& x) const +{ + if (!op_directSolver_) + throw std::runtime_error("Coarse Solver not initialized."); + op_directSolver_->solveInPlace(x); +} + +// --------------- // +// Apply Smoothing // +void Level::initializeSmoothing(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads, + const StencilDistributionMethod stencil_distribution_method) +{ + if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { + op_smoother_ = std::make_unique(*grid_, *level_cache_, domain_geometry, + density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { + op_smoother_ = std::make_unique(*grid_, *level_cache_, domain_geometry, + density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + if (!op_smoother_) + throw std::runtime_error("Failed to initialize Smoother."); +} +void Level::smoothing(Vector& x, const Vector& rhs, Vector& temp) const +{ + if (!op_smoother_) + throw std::runtime_error("Smoother not initialized."); + op_smoother_->smoothing(x, rhs, temp); +} + +// ---------------------------- // +// Apply Extrapolated Smoothing // +void Level::initializeExtrapolatedSmoothing(const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, + const bool DirBC_Interior, const int num_omp_threads, + const StencilDistributionMethod stencil_distribution_method) +{ + if (stencil_distribution_method == StencilDistributionMethod::CPU_TAKE) { + op_extrapolated_smoother_ = std::make_unique( + *grid_, *level_cache_, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + else if (stencil_distribution_method == StencilDistributionMethod::CPU_GIVE) { + op_extrapolated_smoother_ = std::make_unique( + *grid_, *level_cache_, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads); + } + if (!op_extrapolated_smoother_) + throw std::runtime_error("Failed to initialize Extrapolated Smoother."); +} +void Level::extrapolatedSmoothing(Vector& x, const Vector& rhs, Vector& temp) const +{ + if (!op_extrapolated_smoother_) + throw std::runtime_error("Extrapolated Smoother not initialized."); + op_extrapolated_smoother_->extrapolatedSmoothing(x, rhs, temp); +} diff --git a/src/Level/levelCache.cpp b/src/Level/levelCache.cpp new file mode 100644 index 00000000..f27261d2 --- /dev/null +++ b/src/Level/levelCache.cpp @@ -0,0 +1,195 @@ +#include "../../include/Level/level.h" + +LevelCache::LevelCache(const PolarGrid& grid, const DensityProfileCoefficients& density_profile_coefficients, + const DomainGeometry& domain_geometry, const bool cache_density_profile_coefficients, + const bool cache_domain_geometry) + : density_profile_coefficients_(density_profile_coefficients) + , domain_geometry_(domain_geometry) + , sin_theta_(grid.ntheta()) + , cos_theta_(grid.ntheta()) + , cache_density_profile_coefficients_(cache_density_profile_coefficients) + // If the domain geometry is cached, we don't need to cache the alpha coefficient + , coeff_alpha_((cache_density_profile_coefficients && !cache_domain_geometry) ? grid.nr() : 0) + , coeff_beta_(cache_density_profile_coefficients ? grid.nr() : 0) + , cache_domain_geometry_(cache_domain_geometry) + , arr_(cache_domain_geometry ? grid.numberOfNodes() : 0) + , att_(cache_domain_geometry ? grid.numberOfNodes() : 0) + , art_(cache_domain_geometry ? grid.numberOfNodes() : 0) + , detDF_(cache_domain_geometry ? grid.numberOfNodes() : 0) +{ +#pragma omp parallel for + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + const double theta = grid.theta(i_theta); + sin_theta_[i_theta] = sin(theta); + cos_theta_[i_theta] = cos(theta); + } + + if (cache_density_profile_coefficients_) { +#pragma omp parallel for + for (int i_r = 0; i_r < grid.nr(); i_r++) { + const double r = grid.radius(i_r); + if (!cache_domain_geometry_) { + coeff_alpha_[i_r] = density_profile_coefficients.alpha(r); + } + coeff_beta_[i_r] = density_profile_coefficients.beta(r); + } + } + + if (cache_domain_geometry_) { +#pragma omp parallel for + for (int i_r = 0; i_r < grid.numberSmootherCircles(); i_r++) { + const double r = grid.radius(i_r); + double coeff_alpha = density_profile_coefficients.alpha(r); + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + const double theta = grid.theta(i_theta); + const double sin_theta = sin_theta_[i_theta]; + const double cos_theta = cos_theta_[i_theta]; + const double index = grid.index(i_r, i_theta); + + double arr, att, art, detDF; + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + detDF_[index] = detDF; + arr_[index] = arr; + att_[index] = att; + art_[index] = art; + } + } + +#pragma omp parallel for + for (int i_theta = 0; i_theta < grid.ntheta(); i_theta++) { + const double theta = grid.theta(i_theta); + const double sin_theta = sin_theta_[i_theta]; + const double cos_theta = cos_theta_[i_theta]; + for (int i_r = grid.numberSmootherCircles(); i_r < grid.nr(); i_r++) { + const double r = grid.radius(i_r); + const double index = grid.index(i_r, i_theta); + + double coeff_alpha; + if (cache_density_profile_coefficients_ && !cache_domain_geometry_) { + coeff_alpha = coeff_alpha_[i_r]; + } + else { + coeff_alpha = density_profile_coefficients.alpha(r); + } + + double arr, att, art, detDF; + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + detDF_[index] = detDF; + arr_[index] = arr; + att_[index] = att; + art_[index] = art; + } + } + } +} + +LevelCache::LevelCache(const Level& previous_level, const PolarGrid& current_grid) + : density_profile_coefficients_(previous_level.levelCache().densityProfileCoefficients()) + , domain_geometry_(previous_level.levelCache().domainGeometry()) + , sin_theta_(current_grid.ntheta()) + , cos_theta_(current_grid.ntheta()) + , cache_density_profile_coefficients_(previous_level.levelCache().cacheDensityProfileCoefficients()) + , coeff_alpha_(previous_level.levelCache().coeff_alpha().size() > 0 ? current_grid.nr() : 0) + , coeff_beta_(previous_level.levelCache().coeff_beta().size() > 0 ? current_grid.nr() : 0) + , cache_domain_geometry_(previous_level.levelCache().cacheDomainGeometry()) + , arr_(previous_level.levelCache().arr().size() > 0 ? current_grid.numberOfNodes() : 0) + , att_(previous_level.levelCache().att().size() > 0 ? current_grid.numberOfNodes() : 0) + , art_(previous_level.levelCache().art().size() > 0 ? current_grid.numberOfNodes() : 0) + , detDF_(previous_level.levelCache().detDF().size() > 0 ? current_grid.numberOfNodes() : 0) +{ + const auto& previous_level_cache = previous_level.levelCache(); + + for (int i_theta = 0; i_theta < current_grid.ntheta(); i_theta++) { + const double theta = current_grid.theta(i_theta); + sin_theta_[i_theta] = previous_level_cache.sin_theta()[2 * i_theta]; + cos_theta_[i_theta] = previous_level_cache.cos_theta()[2 * i_theta]; + } + + if (previous_level_cache.cacheDensityProfileCoefficients()) { + for (int i_r = 0; i_r < current_grid.nr(); i_r++) { + if (!previous_level_cache.cacheDomainGeometry()) { + coeff_alpha_[i_r] = previous_level_cache.coeff_alpha()[2 * i_r]; + } + coeff_beta_[i_r] = previous_level_cache.coeff_beta()[2 * i_r]; + } + } + + if (previous_level_cache.cacheDomainGeometry()) { +#pragma omp parallel for + for (int i_r = 0; i_r < current_grid.numberSmootherCircles(); i_r++) { + for (int i_theta = 0; i_theta < current_grid.ntheta(); i_theta++) { + const int current_index = current_grid.index(i_r, i_theta); + const int previous_index = previous_level.grid().index(2 * i_r, 2 * i_theta); + arr_[current_index] = previous_level_cache.arr()[previous_index]; + att_[current_index] = previous_level_cache.att()[previous_index]; + art_[current_index] = previous_level_cache.art()[previous_index]; + detDF_[current_index] = previous_level_cache.detDF()[previous_index]; + } + } +#pragma omp parallel for + for (int i_theta = 0; i_theta < current_grid.ntheta(); i_theta++) { + for (int i_r = current_grid.numberSmootherCircles(); i_r < current_grid.nr(); i_r++) { + const int current_index = current_grid.index(i_r, i_theta); + const int previous_index = previous_level.grid().index(2 * i_r, 2 * i_theta); + arr_[current_index] = previous_level_cache.arr()[previous_index]; + att_[current_index] = previous_level_cache.att()[previous_index]; + art_[current_index] = previous_level_cache.art()[previous_index]; + detDF_[current_index] = previous_level_cache.detDF()[previous_index]; + } + } + } +} + +const DensityProfileCoefficients& LevelCache::densityProfileCoefficients() const +{ + return density_profile_coefficients_; +} +const DomainGeometry& LevelCache::domainGeometry() const +{ + return domain_geometry_; +} + +const std::vector& LevelCache::sin_theta() const +{ + return sin_theta_; +} +const std::vector& LevelCache::cos_theta() const +{ + return cos_theta_; +} + +bool LevelCache::cacheDensityProfileCoefficients() const +{ + return cache_density_profile_coefficients_; +} +const std::vector& LevelCache::coeff_alpha() const +{ + return coeff_alpha_; +} +const std::vector& LevelCache::coeff_beta() const +{ + return coeff_beta_; +} + +bool LevelCache::cacheDomainGeometry() const +{ + return cache_domain_geometry_; +} +const Vector& LevelCache::arr() const +{ + return arr_; +} +const Vector& LevelCache::att() const +{ + return att_; +} +const Vector& LevelCache::art() const +{ + return art_; +} +const Vector& LevelCache::detDF() const +{ + return detDF_; +} \ No newline at end of file diff --git a/src/PolarGrid/anisotropic_division.cpp b/src/PolarGrid/anisotropic_division.cpp new file mode 100644 index 00000000..e18641c0 --- /dev/null +++ b/src/PolarGrid/anisotropic_division.cpp @@ -0,0 +1,101 @@ +#include "../../include/PolarGrid/polargrid.h" + +void PolarGrid::RadialAnisotropicDivision(std::vector& r_temp, const double& R0, const double& R, + const int nr_exp, const double& refinement_radius, + const int anisotropic_factor) const +{ + // Calculate the percentage of refinement_radius. + const double percentage = (refinement_radius - R0) / (R - R0); + assert(percentage >= 0.0 && percentage <= 1.0); + + // 1) uniform division with nr=2^dummy_lognr - 2^aniso + // 2) remaining nodes are added by refining the part centered around 2/3 of r + std::set>::iterator itr, itr_p1; + // very ugly anisotropy hack.... dividing recursively smaller and smaller number of cells + + /* uniform division of r in 2^nr_exp - 2^aniso */ + int dummy_lognr = nr_exp; + int n_elems_equi = pow(2, dummy_lognr) - pow(2, anisotropic_factor); + if (anisotropic_factor < 0 || n_elems_equi <= 0) { + throw std::runtime_error("Please choose anisotropy factor a such that 2^fac_ani < 2^nr_exp.\n"); + } + + if ((anisotropic_factor % 2) == + 1) // odd number of elements on an open circular disk is desired because of coarsening + n_elems_equi++; + double uniform_distance = (R - R0) / n_elems_equi; + int nr = n_elems_equi + 1; + std::vector r_temp2 = std::vector(nr); + for (int i = 0; i < nr - 1; i++) + r_temp2[i] = R0 + i * uniform_distance; + r_temp2[nr - 1] = R; + + /* refine around 2/3 of r */ + int n_elems_refined = pow(2, anisotropic_factor); + + // edge + int se; + + // Added by Allan Kuhn to fix a memory error + if (floor(nr * percentage) > nr - (n_elems_refined / 2)) { + int new_aniso = log2(nr - floor(nr * percentage)) + 1; + n_elems_refined = pow(2, new_aniso); + } + + se = floor(nr * percentage) - n_elems_refined / 2; + int ee = se + n_elems_refined; + // takeout + int st = ceil((double)n_elems_refined / 4.0 + 1) - 1; + int et = floor(3 * ((double)n_elems_refined / 4.0)); + + std::set r_set; + std::set r_set_p1; + int count = 0; + for (int i = 0; i < n_elems_refined; i++) { + r_set_p1.insert(r_temp2[se + i]); + count++; + } + double half = uniform_distance / 2.0; + for (int k = 0; k < anisotropic_factor; k++) { + std::set r_set_p1_tmp; + itr_p1 = r_set_p1.begin(); + int r_size = count; + count = 0; + for (int i = 0; i < r_size - 1; i++) { + r_set.insert((*itr_p1) + half); + if (k < anisotropic_factor - 1 && i >= st && i < et) { + r_set_p1_tmp.insert(*(itr_p1)); + r_set_p1_tmp.insert(*(itr_p1) + half); + count += 2; + } + itr_p1++; + } + r_set_p1 = r_set_p1_tmp; + half *= 0.5; + } + + // such that the total size is 8*x+1 (or we do not refine) + nr = nr + r_set.size(); + int shift = 0; + shift = std::min(nr % 8 - 1, (int)r_set.size()); + itr = r_set.begin(); + std::advance(itr, shift); + r_set.erase(r_set.begin(), itr); + for (int i = 0; i < n_elems_refined; i++) + r_set.insert(r_temp2[se + i]); + + // group all in r_tmp + nr = n_elems_equi - n_elems_refined + r_set.size() + 1; + + r_temp.resize(nr); + + for (int i = 0; i < se; i++) + r_temp[i] = r_temp2[i]; + itr = r_set.begin(); + for (int i = 0; i < (int)r_set.size(); i++) { + r_temp[se + i] = *itr; + itr++; + } + for (int i = 0; i < n_elems_equi - ee + 1; i++) + r_temp[se + r_set.size() + i] = r_temp2[ee + i]; +} \ No newline at end of file diff --git a/src/PolarGrid/load_write_grid.cpp b/src/PolarGrid/load_write_grid.cpp new file mode 100644 index 00000000..cf547916 --- /dev/null +++ b/src/PolarGrid/load_write_grid.cpp @@ -0,0 +1,55 @@ +#include "../../include/PolarGrid/polargrid.h" + +void PolarGrid::writeToFile(const std::string& file_r, const std::string& file_theta, const int precision) const +{ + writeVectorToFile(file_r, radii_, precision); + writeVectorToFile(file_theta, angles_, precision); +} + +void PolarGrid::writeVectorToFile(const std::string& filename, const std::vector& vector, + const int precision) const +{ + // Open the file for writing + std::ofstream outputFile(filename); + + // Check if the file is opened successfully + if (!outputFile.is_open()) { + std::cerr << "Error opening file: " << filename << std::endl; + return; + } + + // Set the precision for output file + outputFile << std::fixed << std::setprecision(precision); + + // Write each double from the vector to the file + for (const auto& num : vector) { + outputFile << num << std::endl; + } + + // Close the file + outputFile.close(); +} + +void PolarGrid::loadVectorFromFile(const std::string& filename, std::vector& vector) const +{ + // Open the file for reading + std::ifstream inputFile(filename); + + // Check if the file is opened successfully + if (!inputFile.is_open()) { + std::cerr << "Error opening file: " << filename << std::endl; + return; + } + + // Clear the vector before loading new data + vector.clear(); + + // Read data from the file into the vector + double value; + while (inputFile >> value) { + vector.push_back(value); + } + + // Close the file + inputFile.close(); +} \ No newline at end of file diff --git a/src/PolarGrid/multiindex.cpp b/src/PolarGrid/multiindex.cpp new file mode 100644 index 00000000..ec3c16a3 --- /dev/null +++ b/src/PolarGrid/multiindex.cpp @@ -0,0 +1,71 @@ +#include "../../include/PolarGrid/multiindex.h" + +MultiIndex::MultiIndex(int value) +{ + assert(space_dimension >= 0); + std::fill(std::begin(data_), std::end(data_), value); +} + +MultiIndex::MultiIndex(int i, int j) +{ + assert(space_dimension == 2); + data_[0] = i; + data_[1] = j; +} + +MultiIndex::MultiIndex(int i, int j, int k) +{ + assert(space_dimension == 3); + data_[0] = i; + data_[1] = j; + data_[2] = k; +} + +int MultiIndex::size() const +{ + return space_dimension; +} + +bool MultiIndex::operator==(const MultiIndex& other) const +{ + for (int d = 0; d < space_dimension; d++) { + if (data_[d] != other.data_[d]) { + return false; + } + } + return true; +} + +bool MultiIndex::operator!=(const MultiIndex& other) const +{ + for (int d = 0; d < space_dimension; d++) { + if (data_[d] != other.data_[d]) { + return true; + } + } + return false; +} + +const int& MultiIndex::operator[](int i) const +{ + assert(i >= 0); + assert(i < space_dimension); + return data_[i]; +} + +int& MultiIndex::operator[](int i) +{ + assert(i >= 0); + assert(i < space_dimension); + return data_[i]; +} + +int* MultiIndex::data() +{ + return data_; +} + +const int* MultiIndex::data() const +{ + return data_; +} \ No newline at end of file diff --git a/src/PolarGrid/point.cpp b/src/PolarGrid/point.cpp new file mode 100644 index 00000000..95e87115 --- /dev/null +++ b/src/PolarGrid/point.cpp @@ -0,0 +1,85 @@ +#include "../../include/PolarGrid/point.h" + +Point::Point(double value) +{ + assert(space_dimension >= 0); + std::fill(std::begin(data_), std::end(data_), value); +} + +Point::Point(double x, double y) +{ + assert(space_dimension == 2); + data_[0] = x; + data_[1] = y; +} + +Point::Point(double x, double y, double z) +{ + assert(space_dimension == 3); + data_[0] = x; + data_[1] = y; + data_[2] = z; +} + +int Point::size() const +{ + return space_dimension; +} + +const double& Point::operator[](int i) const +{ + assert(i >= 0); + assert(i < space_dimension); + return data_[i]; +} + +double& Point::operator[](int i) +{ + assert(i >= 0); + assert(i < space_dimension); + return data_[i]; +} + +bool equals(const Point& lhs, const Point& rhs) +{ + for (int i = 0; i < space_dimension; ++i) { + if (!equals(lhs[i], rhs[i])) + return false; + } + return true; +} + +double norm(const Point& point) +{ + double result = 0; + for (int i = 0; i < space_dimension; ++i) { + result += point[i] * point[i]; + } + return sqrt(result); +} + +void add(Point& result, const Point& lhs, const Point& rhs) +{ + assert(lhs.size() == rhs.size()); + assert(result.size() == lhs.size()); + for (int i = 0; i < space_dimension; i++) { + result[i] = lhs[i] + rhs[i]; + } +} + +void subtract(Point& result, const Point& lhs, const Point& rhs) +{ + assert(lhs.size() == rhs.size()); + assert(result.size() == lhs.size()); + for (int i = 0; i < space_dimension; i++) { + result[i] = lhs[i] - rhs[i]; + } +} + +void multiply(Point& result, const double& scalar, const Point& lhs) +{ + assert(result.size() == lhs.size()); + for (int i = 0; i < space_dimension; i++) { + result[i] = scalar * lhs[i]; + } +} \ No newline at end of file diff --git a/src/PolarGrid/polargrid.cpp b/src/PolarGrid/polargrid.cpp new file mode 100644 index 00000000..329c3f46 --- /dev/null +++ b/src/PolarGrid/polargrid.cpp @@ -0,0 +1,441 @@ +#include "../../include/PolarGrid/polargrid.h" + +// ------------ // +// Constructors // +// ------------ // + +// Constructor to initialize grid using vectors of radii and angles. +PolarGrid::PolarGrid(const std::vector& radii, const std::vector& angles, + std::optional splitting_radius) + : nr_(radii.size()) + , ntheta_(angles.size() - 1) + , is_ntheta_PowerOfTwo_((ntheta_ & (ntheta_ - 1)) == 0) + , radii_(radii) + , angles_(angles) +{ + // Check parameter validity + checkParameters(radii, angles); + // Store distances to adjacent neighboring nodes. + // Initializes radial_spacings_, angular_spacings_ + initializeDistances(); + // Initializes smoothers splitting radius for circle/radial indexing. + initializeLineSplitting(splitting_radius); +} + +// Constructor to initialize grid using data from text files containing radii and angles. +PolarGrid::PolarGrid(const std::string& file_grid_radii, const std::string& file_grid_angles, + std::optional splitting_radius) +{ + // Construct radii_ and angles_ from text files + loadVectorFromFile(file_grid_radii, radii_); + loadVectorFromFile(file_grid_angles, angles_); + nr_ = radii_.size(); + ntheta_ = angles_.size() - 1; + is_ntheta_PowerOfTwo_ = (ntheta_ & (ntheta_ - 1)) == 0; + // Check parameter validity + checkParameters(radii_, angles_); + // Store distances to adjacent neighboring nodes. + // Initializes radial_spacings_, angular_spacings_ + initializeDistances(); + // Initializes smoothers splitting radius for circle/radial indexing. + initializeLineSplitting(splitting_radius); +} + +// Constructor to initialize grid using parameters from GMGPolar. +PolarGrid::PolarGrid(const double& R0, const double& Rmax, const int nr_exp, const int ntheta_exp, + const double& refinement_radius, const int anisotropic_factor, const int divideBy2, + std::optional splitting_radius) +{ + assert(R0 > 0.0 && Rmax > R0 && !equals(R0, Rmax)); + // Construct radii_ and angles_ + constructRadialDivisions(R0, Rmax, nr_exp, refinement_radius, anisotropic_factor); + constructAngularDivisions(ntheta_exp, nr_); + refineGrid(divideBy2); + // Check parameter validity + checkParameters(radii_, angles_); + // Store distances to adjacent neighboring nodes. + // Initializes radial_spacings_, angular_spacings_ + initializeDistances(); + // Initializes smoothers splitting radius for circle/radial indexing. + initializeLineSplitting(splitting_radius); +} + +// ------------------- // +// Constructor Helpers // +// ------------------- // + +// Construct radial divisions for grid generation. +void PolarGrid::constructRadialDivisions(const double& R0, const double& R, const int nr_exp, + const double& refinement_radius, const int anisotropic_factor) +{ + // r_temp contains the values before we refine one last time for extrapolation. + // Therefore we first consider 2^(nr_exp-1) points. + std::vector r_temp; + if (anisotropic_factor == 0) { + int nr = pow(2, nr_exp - 1) + 1; + double uniform_distance = (R - R0) / (nr - 1); + assert(uniform_distance > 0.0); + r_temp.resize(nr); + for (int i = 0; i < nr - 1; i++) { + r_temp[i] = R0 + i * uniform_distance; + } + r_temp[nr - 1] = R; + } + else { + // Implementation in src/PolarGrid/anisotropic_division.cpp + RadialAnisotropicDivision(r_temp, R0, R, nr_exp, refinement_radius, anisotropic_factor); + } + // Refine division in the middle for extrapolation + nr_ = 2 * r_temp.size() - 1; + radii_.resize(nr_); + for (int i = 0; i < nr_; i++) { + if (!(i % 2)) + radii_[i] = r_temp[i / 2]; + else + radii_[i] = 0.5 * (r_temp[(i - 1) / 2] + r_temp[(i + 1) / 2]); + } +} + +// Construct angular divisions for grid generation. +// Currently we dont allow anisotropic refinement in angular direction +void PolarGrid::constructAngularDivisions(const int ntheta_exp, const int nr) +{ + if (ntheta_exp < 0) { + // Choose number of theta divisions similar to radial divisions. + ntheta_ = pow(2, ceil(log2(nr))); + // ntheta_ = pow(2, ceil(log2(nr-1))); + } + else { + ntheta_ = pow(2, ntheta_exp); + } + is_ntheta_PowerOfTwo_ = (ntheta_ & (ntheta_ - 1)) == 0; + // Note that currently ntheta_ = 2^k which allows us to do some optimizations when indexing. + double uniform_distance = 2 * M_PI / ntheta_; + angles_.resize(ntheta_ + 1); + for (int i = 0; i < ntheta_; i++) { + angles_[i] = i * uniform_distance; + } + angles_[ntheta_] = 2 * M_PI; +} + +// divideBy2: Number of times to divide both radial and angular divisions by 2. +void PolarGrid::refineGrid(const int divideBy2) +{ + radii_ = divideVector(radii_, divideBy2); + angles_ = divideVector(angles_, divideBy2); + nr_ = radii_.size(); + ntheta_ = angles_.size() - 1; + is_ntheta_PowerOfTwo_ = (ntheta_ & (ntheta_ - 1)) == 0; +} + +std::vector PolarGrid::divideVector(const std::vector& vec, const int divideBy2) const +{ + const double powerOfTwo = 1 << divideBy2; + size_t vecSize = vec.size(); + size_t resultSize = vecSize + (vecSize - 1) * (powerOfTwo - 1); + std::vector result(resultSize); + + for (size_t i = 0; i < vecSize - 1; ++i) { + size_t baseIndex = i * powerOfTwo; + result[baseIndex] = vec[i]; // Add the original value + for (int j = 1; j < powerOfTwo; ++j) { + double interpolated_value = vec[i] + j * (vec[i + 1] - vec[i]) / powerOfTwo; + result[baseIndex + j] = interpolated_value; + } + } + result[resultSize - 1] = vec.back(); // Add the last value of the original vector + return result; +} + +void PolarGrid::initializeDistances() +{ + // radial_spacings contains the distances between each consecutive radii division. + // radial_spacings = [R_1-R0, ..., R_{N} - R_{N-1}]. + radial_spacings_.resize(nr() - 1); + for (int i = 0; i < nr() - 1; i++) { + radial_spacings_[i] = radius(i + 1) - radius(i); + } + // angular_spacings contains the angles between each consecutive theta division. + // Since we have a periodic boundary in theta direction, + // we have to make sure the index wraps around correctly when accessing it. + // Here theta_0 = 0.0 and theta_N = 2*pi refer to the same point. + // angular_spacings = [theta_{1}-theta_{0}, ..., theta_{N}-theta_{N-1}]. + angular_spacings_.resize(ntheta()); + for (int i = 0; i < ntheta(); i++) { + angular_spacings_[i] = theta(i + 1) - theta(i); + } +} + +// Initializes line splitting parameters for Circle/radial indexing. +// splitting_radius: The radius value used for dividing the smoother into a circular and radial section. +// If std::nullopt, automatic line-splitting is enabled. +// If the splitting radius is less than R0, only Radial indexing is used. +// If the splitting radius is greater than or equal to R, only Circular indexing is used. +void PolarGrid::initializeLineSplitting(std::optional splitting_radius) +{ + if (splitting_radius.has_value()) { + if (splitting_radius.value() < radii_.front()) { + number_smoother_circles_ = 0; + length_smoother_radial_ = nr(); + smoother_splitting_radius_ = -1.0; + } + else { + auto it = std::lower_bound(radii_.begin(), radii_.end(), splitting_radius.value()); + if (it != radii_.end()) { + number_smoother_circles_ = std::distance(radii_.begin(), it); + length_smoother_radial_ = nr() - number_smoother_circles_; + smoother_splitting_radius_ = splitting_radius.value(); + } + else { + number_smoother_circles_ = nr(); + length_smoother_radial_ = 0; + smoother_splitting_radius_ = radii_.back() + 1.0; + } + } + } + else { + number_smoother_circles_ = 2; /* We assume numberSmootherCircles_ >= 2 in the further implementation */ + for (int i_r = 2; i_r < nr() - 2; + i_r++) { /* We assume lengthSmootherRadial_ >= 3 in the further implementation */ + double uniform_theta_k = (2 * M_PI) / ntheta(); + double radius_r = radius(i_r); + double radial_dist_h = radius(i_r) - radius(i_r - 1); + ; + double q = uniform_theta_k / radial_dist_h; + if (q * radius_r > 1.0) { + number_smoother_circles_ = i_r; + break; + } + } + /* The ExtrapolatedSmoother requires numberSmootherCircles_ >= 3 and lengthSmootherRadial_ >= 3. */ + if (number_smoother_circles_ < 3 && nr() > 5) + number_smoother_circles_ = 3; + + length_smoother_radial_ = nr() - number_smoother_circles_; + smoother_splitting_radius_ = radius(number_smoother_circles_); + } + + number_circular_smoother_nodes_ = number_smoother_circles_ * ntheta(); + number_radial_smoother_nodes_ = length_smoother_radial_ * ntheta(); + + assert(numberSmootherCircles() + lengthSmootherRadial() == nr()); + assert(numberCircularSmootherNodes() + numberRadialSmootherNodes() == numberOfNodes()); +} + +// ---------------------------------------------------- // +// Generates a coarser PolarGrid from a finer PolarGrid // +// ---------------------------------------------------- // + +PolarGrid coarseningGrid(const PolarGrid& fineGrid) +{ + assert((fineGrid.nr() - 1) % 2 == 0 && (fineGrid.ntheta()) % 2 == 0); + const int coarse_nr = (fineGrid.nr() + 1) / 2; + const int coarse_ntheta = fineGrid.ntheta() / 2; + + std::vector coarse_r(coarse_nr); + std::vector coarse_theta(coarse_ntheta + 1); + + for (int i = 0; i < coarse_nr; i++) { + coarse_r[i] = fineGrid.radius(2 * i); + } + for (int j = 0; j < coarse_ntheta + 1; j++) { + coarse_theta[j] = fineGrid.theta(2 * j); + } + + const bool use_same_splitting_radius = false; + + if (use_same_splitting_radius) { + return PolarGrid(coarse_r, coarse_theta, fineGrid.smootherSplittingRadius()); + } + else { + return PolarGrid(coarse_r, coarse_theta); + } +} + +// ---------------- // +// Getter Functions // +// ---------------- // + +const std::vector& PolarGrid::radii() const +{ + return radii_; +} +const std::vector& PolarGrid::angles() const +{ + return angles_; +} + +// Get the radius at which the grid is split into circular and radial smoothing +double PolarGrid::smootherSplittingRadius() const +{ + return smoother_splitting_radius_; +} + +// ------------------------------------- // +// Definition of node indexing. // +// Based on the circular-radial smoother // +// ------------------------------------- // + +/* OPTIMIZED INDEXING IS DEFINED IN include/PolarGrid/polargrid.inl */ + +int PolarGrid::index(const MultiIndex& position) const +{ + assert(position[0] >= 0 && position[0] < nr()); + assert(position[1] >= 0 && position[1] < ntheta()); + if (position[0] < numberSmootherCircles()) { + return position[1] + ntheta() * position[0]; + } + else { + return numberCircularSmootherNodes() + + (position[0] - numberSmootherCircles() + lengthSmootherRadial() * position[1]); + } +} + +MultiIndex PolarGrid::multiIndex(const int node_index) const +{ + assert(0 <= node_index && node_index < numberOfNodes()); + if (node_index < numberCircularSmootherNodes()) { + auto result = std::div(node_index, ntheta()); + return MultiIndex(result.quot, result.rem); + } + else { + auto result = std::div(node_index - numberCircularSmootherNodes(), lengthSmootherRadial()); + return MultiIndex(numberSmootherCircles() + result.rem, result.quot); + } +} + +Point PolarGrid::polarCoordinates(const MultiIndex& position) const +{ + assert(position[0] >= 0 && position[0] < nr()); + assert(position[1] >= 0 && position[1] < ntheta()); + return Point(radii_[position[0]], angles_[(position[1])]); +} + +void PolarGrid::adjacentNeighborDistances( + const MultiIndex& position, std::array, space_dimension>& neighbor_distance) const +{ + assert(position[0] >= 0 && position[0] < nr()); + assert(position[1] >= 0 && position[1] < ntheta()); + + neighbor_distance[0].first = (position[0] <= 0) ? 0.0 : radialSpacing(position[0] - 1); + neighbor_distance[0].second = (position[0] >= nr() - 1) ? 0.0 : radialSpacing(position[0]); + + neighbor_distance[1].first = angularSpacing(position[1] - 1); + neighbor_distance[1].second = angularSpacing(position[1]); +} + +void PolarGrid::adjacentNeighborsOf(const MultiIndex& position, + std::array, space_dimension>& neighbors) const +{ + assert(position[0] >= 0 && position[0] < nr()); + assert(position[1] >= 0 && position[1] < ntheta()); + + MultiIndex neigbor_position = position; + neigbor_position[0] -= 1; + neighbors[0].first = (neigbor_position[0] < 0) ? -1 : index(neigbor_position); + + neigbor_position = position; + neigbor_position[0] += 1; + neighbors[0].second = (neigbor_position[0] >= nr()) ? -1 : index(neigbor_position); + + neigbor_position = position; + neigbor_position[1] -= 1; + if (neigbor_position[1] < 0) + neigbor_position[1] += ntheta(); + neighbors[1].first = index(neigbor_position); + + neigbor_position = position; + neigbor_position[1] += 1; + if (neigbor_position[1] >= ntheta()) + neigbor_position[1] -= ntheta(); + neighbors[1].second = index(neigbor_position); +} + +void PolarGrid::diagonalNeighborsOf(const MultiIndex& position, + std::array, space_dimension>& neighbors) const +{ + assert(position[0] >= 0 && position[0] < nr()); + assert(position[1] >= 0 && position[1] < ntheta()); + + MultiIndex neigbor_position = position; + neigbor_position[0] -= 1; + neigbor_position[1] -= 1; + if (neigbor_position[1] < 0) + neigbor_position[1] += ntheta(); + neighbors[0].first = (neigbor_position[0] < 0) ? -1 : index(neigbor_position); + + neigbor_position = position; + neigbor_position[0] += 1; + neigbor_position[1] -= 1; + if (neigbor_position[1] < 0) + neigbor_position[1] += ntheta(); + neighbors[0].second = (neigbor_position[0] >= nr()) ? -1 : index(neigbor_position); + + neigbor_position = position; + neigbor_position[0] -= 1; + neigbor_position[1] += 1; + if (neigbor_position[1] >= ntheta()) + neigbor_position[1] -= ntheta(); + neighbors[1].first = (neigbor_position[0] < 0) ? -1 : index(neigbor_position); + + neigbor_position = position; + neigbor_position[0] += 1; + neigbor_position[1] += 1; + if (neigbor_position[1] >= ntheta()) + neigbor_position[1] -= ntheta(); + neighbors[1].second = (neigbor_position[0] >= nr()) ? -1 : index(neigbor_position); +} + +// ------------------------ // +// Check parameter validity // +// ---------------------..- // + +void PolarGrid::checkParameters(const std::vector& radii, const std::vector& angles) const +{ + if (radii.size() < 2) { + throw std::invalid_argument("At least two radii are required."); + } + + if (!std::all_of(radii.begin(), radii.end(), [](double r) { + return r > 0.0; + })) { + throw std::invalid_argument("All radii must be greater than zero."); + } + + if (std::adjacent_find(radii.begin(), radii.end(), std::greater_equal()) != radii.end()) { + throw std::invalid_argument("Radii must be strictly increasing."); + } + + if (angles.size() < 3) { + throw std::invalid_argument("At least two angles are required."); + } + + if (!std::all_of(angles.begin(), angles.end(), [](double theta) { + return theta >= 0.0; + })) { + throw std::invalid_argument("All angles must be non-negative."); + } + + if (std::adjacent_find(angles.begin(), angles.end(), std::greater_equal()) != angles.end()) { + throw std::invalid_argument("Angles must be strictly increasing."); + } + + if (!equals(angles.front(), 0.0)) { + throw std::invalid_argument("First angle must be 0."); + } + + if (!equals(angles.back(), 2 * M_PI)) { + throw std::invalid_argument("Last angle must be 2*pi."); + } + + // Additional constraint for our stencil. Not needed in general. + if (!std::all_of(angles.begin(), angles.end(), [&angles](double theta) { + double opposite = theta + M_PI >= 2 * M_PI ? theta - M_PI : theta + M_PI; + return std::find_if(angles.begin(), angles.end(), [&opposite](double angle) { + return equals(opposite, angle); + }) != angles.end(); + })) { + throw std::invalid_argument("Each angle must have its opposite in the set:\n" + "Every node in the interior ring needs to have an opposite neighboring node."); + } +} \ No newline at end of file diff --git a/src/RHS.cpp b/src/RHS.cpp deleted file mode 100644 index 109d82fd..00000000 --- a/src/RHS.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/*! - * \file RHS.cpp - * \brief Implementation of the right hand side - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gyro.h" - -/*! - * \brief Defines the RHS (single) - * - * Defines the RHS on (r, theta) - * - */ -double gyro::eval_def_rhs(double r, double theta, int verbose) -{ - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double rhs_val = 0; - if (r > 0) { - rhs_val = functions->rho_glob(r, theta, kappa_eps, delta_e, Rmax); - } - else { - rhs_val = functions->rho_pole(r, theta, kappa_eps, delta_e, Rmax); - } - if (verbose) { - std::cout << "RHS(" << r << ", " << theta << "): " << rhs_val << "\n"; - } - return rhs_val; -} /* ----- end of gyro::eval_def_rhs ----- */ - -/*! - * \brief Defines the RHS (vector) - * - * Defines the RHS for a whole radius - * - */ -std::vector gyro::eval_def_rhs(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose) -{ - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - std::vector rhs_val(ntheta); - if (r > 0) { - functions->rho_glob(r, theta, kappa_eps, delta_e, Rmax, rhs_val, sin_theta, cos_theta); - } - else { - functions->rho_pole(r, theta, kappa_eps, delta_e, Rmax, rhs_val, sin_theta, cos_theta); - } - if (verbose) { - for (int i = 0; i < ntheta; i++) - std::cout << "RHS(" << r << ", " << theta[i] << "): " << rhs_val[i] << "\n"; - } - return rhs_val; -} /* ----- end of gyro::eval_def_rhs ----- */ diff --git a/src/Residual/ResidualGive/applyAGive.cpp b/src/Residual/ResidualGive/applyAGive.cpp new file mode 100644 index 00000000..fd65dcd4 --- /dev/null +++ b/src/Residual/ResidualGive/applyAGive.cpp @@ -0,0 +1,278 @@ +#include "../../../include/Residual/ResidualGive/residualGive.h" + +#include "../../../include/common/geometry_helper.h" + +#define NODE_APPLY_A_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, result, x, arr, att, \ + art, detDF, coeff_beta) \ + do { \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 1 && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* Fill result(i,j) */ \ + result[grid.index(i_r, i_theta)] -= \ + (0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF) * \ + x[grid.index(i_r, i_theta)] /* beta_{i,j} */ \ + - coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ /* Center: (Left, Right, Bottom, Top) */ \ + + ((coeff1 + coeff2) * arr + (coeff3 + coeff4) * att) * x[grid.index(i_r, i_theta)]); \ + /* Fill result(i-1,j) */ \ + result[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + + coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Center: (Right) */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + /* Fill result(i+1,j) */ \ + result[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Center: (Left) */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + /* Fill result(i,j-1) */ \ + result[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + + coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Center: (Top) */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill result(i,j+1) */ \ + result[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Center: (Bottom) */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + /* -------------------------- */ \ + /* Node on the inner boundary */ \ + /* -------------------------- */ \ + } \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + /* Fill result(i,j) */ \ + result[grid.index(i_r, i_theta)] -= x[grid.index(i_r, i_theta)]; \ + /* Give value to the interior nodes! */ \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + /* Fill result(i+1,j) */ \ + result[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Center: (Left) */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* Fill result(i,j) */ \ + result[grid.index(i_r, i_theta)] -= \ + (0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF) * \ + x[grid.index(i_r, i_theta)] /* beta_{i,j} */ \ + - coeff1 * arr * x[grid.index(i_r, i_theta + (grid.ntheta() / 2))] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + + ((coeff1 + coeff2) * arr + (coeff3 + coeff4) * att) * \ + x[grid.index(i_r, i_theta)]); /* Center: (Left, Right, Bottom, Top) */ \ + /* Fill result(i-1,j) */ \ + /* From view the view of the across origin node, the directions are roatated by 180 degrees in the stencil! */ \ + result[grid.index(i_r, i_theta + (grid.ntheta() / 2))] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right -> Left */ \ + + coeff1 * arr * \ + x[grid.index(i_r, i_theta + (grid.ntheta() / 2))]); /* Center: (Right) -> Center: (Left)*/ \ + /* + 0.25 * art * x[grid.index(i_r,i_theta+1)]; // Top Right -> Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + /* - 0.25 * art * x[grid.index(i_r,i_theta-1)]; // Bottom Right -> Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + /* Fill result(i+1,j) */ \ + result[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Center: (Left) */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + /* Fill result(i,j-1) */ \ + result[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + + coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Center: (Top) */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)]); /* Top Right */ \ + /* + 0.25 * art * x[grid.index(i_r-1,i_theta)]; // Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + /* Fill result(i,j+1) */ \ + result[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Center: (Bottom) */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)]); /* Bottom Right */ \ + /* - 0.25 * art * x[grid.index(i_r-1,i_theta)]; // Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + } \ + /* ------------------------------- */ \ + /* Node next to the inner boundary */ \ + /* ------------------------------- */ \ + } \ + else if (i_r == 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* Fill result(i,j) */ \ + result[grid.index(i_r, i_theta)] -= \ + (0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF) * \ + x[grid.index(i_r, i_theta)] /* beta_{i,j} */ \ + - coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + + ((coeff1 + coeff2) * arr + (coeff3 + coeff4) * att) * \ + x[grid.index(i_r, i_theta)]); /* Center: (Left, Right, Bottom, Top) */ \ + /* Fill result(i-1,j) */ \ + if (!DirBC_Interior) { /* Don't give to the inner dirichlet boundary! */ \ + result[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + + coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Center: (Right) */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + /* Fill result(i+1,j) */ \ + result[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Center: (Left) */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + /* Fill result(i,j-1) */ \ + result[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + + coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Center: (Top) */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill result(i,j+1) */ \ + result[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Center: (Bottom) */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + /* ------------------------------- */ \ + /* Node next to the outer boundary */ \ + /* ------------------------------- */ \ + } \ + else if (i_r == grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* Fill result(i,j) */ \ + result[grid.index(i_r, i_theta)] -= \ + (0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF) * \ + x[grid.index(i_r, i_theta)] /* beta_{i,j} */ \ + - coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + + ((coeff1 + coeff2) * arr + (coeff3 + coeff4) * att) * \ + x[grid.index(i_r, i_theta)]); /* Center: (Left, Right, Bottom, Top) */ \ + /* Fill result(i-1,j) */ \ + result[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + + coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Center: (Right) */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + /* Don't give to the outer dirichlet boundary! */ \ + /* Fill result(i+1,j) */ \ + /* result[grid.index(i_r+1,i_theta)] -= ( */ \ + /* - coeff2 * arr * x[grid.index(i_r,i_theta)] // Left */ \ + /* + coeff2 * arr * x[grid.index(i_r+1,i_theta)] // Center: (Left) */ \ + /* + 0.25 * art * x[grid.index(i_r,i_theta+1)] // Top Left */ \ + /* - 0.25 * art * x[grid.index(i_r,i_theta-1)] ); // Bottom Left */ \ + /* Fill result(i,j-1) */ \ + result[grid.index(i_r, i_theta - 1)] -= \ + (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + + coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Center: (Top) */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill result(i,j+1) */ \ + result[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Center: (Bottom) */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + /* ----------------------------- */ \ + /* Node on to the outer boundary */ \ + /* ----------------------------- */ \ + } \ + else if (i_r == grid.nr() - 1) { \ + /* Fill result of (i,j) */ \ + result[grid.index(i_r, i_theta)] -= x[grid.index(i_r, i_theta)]; \ + /* Give value to the interior nodes! */ \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + /* Fill result(i-1,j) */ \ + result[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + + coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Center: (Right) */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + } while (0) + +void ResidualGive::applyCircleSection(const int i_r, Vector& result, const Vector& x) const +{ + const double r = grid_.radius(i_r); + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int global_index = grid_.index(i_r, i_theta); + const double theta = grid_.theta(i_theta); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + NODE_APPLY_A_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, result, x, arr, att, + art, detDF, coeff_beta); + } +} + +void ResidualGive::applyRadialSection(const int i_theta, Vector& result, const Vector& x) const +{ + const double theta = grid_.theta(i_theta); + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int global_index = grid_.index(i_r, i_theta); + const double r = grid_.radius(i_r); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + NODE_APPLY_A_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, result, x, arr, att, + art, detDF, coeff_beta); + } +} \ No newline at end of file diff --git a/src/Residual/ResidualGive/residualGive.cpp b/src/Residual/ResidualGive/residualGive.cpp new file mode 100644 index 00000000..ddf1338c --- /dev/null +++ b/src/Residual/ResidualGive/residualGive.cpp @@ -0,0 +1,104 @@ +#include "../../../include/Residual/ResidualGive/residualGive.h" +#include "../../../include/Residual/residual.h" + +ResidualGive::ResidualGive(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : Residual(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ +} + +/* ------------------ */ +/* result = rhs - A*x */ + +// clang-format off +void ResidualGive::computeResidual(Vector& result, const Vector& rhs, const Vector& x) const +{ + assert(result.size() == x.size()); + omp_set_num_threads(num_omp_threads_); + + result = rhs; + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + applyCircleSection(i_r, result, x); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyRadialSection(i_theta, result, x); + } + } + else { + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int additional_radial_tasks = grid_.ntheta() % 3; + const int num_radial_tasks = grid_.ntheta() - additional_radial_tasks; + + #pragma omp parallel + { + /* Circle Section 0 */ + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + applyCircleSection(i_r, result, x); + } + /* Circle Section 1 */ + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + applyCircleSection(i_r, result, x); + } + /* Circle Section 2 */ + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + applyCircleSection(i_r, result, x); + } + + /* Radial Section 0 */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 0) { + int i_theta = radial_task + additional_radial_tasks; + applyRadialSection(i_theta, result, x); + } + else { + if (additional_radial_tasks == 0) { + applyRadialSection(0, result, x); + } + else if (additional_radial_tasks >= 1) { + applyRadialSection(0, result, x); + applyRadialSection(1, result, x); + } + } + } + /* Radial Section 1 */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 1) { + int i_theta = radial_task + additional_radial_tasks; + applyRadialSection(i_theta, result, x); + } + else { + if (additional_radial_tasks == 0) { + applyRadialSection(1, result, x); + } + else if (additional_radial_tasks == 1) { + applyRadialSection(2, result, x); + } + else if (additional_radial_tasks == 2) { + applyRadialSection(2, result, x); + applyRadialSection(3, result, x); + } + } + } + /* Radial Section 2 */ + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 3) { + int i_theta = radial_task + additional_radial_tasks; + applyRadialSection(i_theta, result, x); + } + } + } +} +// clang-format on \ No newline at end of file diff --git a/src/Residual/ResidualTake/applyResidualTake.cpp b/src/Residual/ResidualTake/applyResidualTake.cpp new file mode 100644 index 00000000..9b091739 --- /dev/null +++ b/src/Residual/ResidualTake/applyResidualTake.cpp @@ -0,0 +1,148 @@ +#include "../../../include/Residual/ResidualTake/residualTake.h" + +#define NODE_APPLY_RESIDUAL_TAKE(i_r, i_theta, grid, DirBC_Interior, result, rhs, x, arr, att, art, detDF, coeff_beta) \ + do { \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 0 && i_r < grid.nr() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + result[center] = \ + rhs[center] - \ + (0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) * x[center] /* beta_{i,j} */ \ + \ + - coeff1 * (arr[center] + arr[left]) * (x[left] - x[center]) /* Left - Center: (Left) */ \ + - coeff2 * (arr[center] + arr[right]) * (x[right] - x[center]) /* Right - Center: (Right) */ \ + - coeff3 * (att[center] + att[bottom]) * (x[bottom] - x[center]) /* Bottom - Center: (Bottom) */ \ + - coeff4 * (att[center] + att[top]) * (x[top] - x[center]) /* Top - Center: (Top) */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + /* -------------------------- */ \ + /* Node on the inner boundary */ \ + /* -------------------------- */ \ + } \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + const int center = grid.index(i_r, i_theta); \ + result[center] = rhs[center] - x[center]; \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid_.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid_.wrapThetaIndex(i_theta + 1); \ + const int i_theta_Across = grid_.wrapThetaIndex(i_theta + grid_.ntheta() / 2); \ + \ + const int left = grid_.index(i_r, i_theta_Across); \ + const int bottom = grid_.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid_.index(i_r, i_theta_P1); \ + const int bottom_right = grid_.index(i_r + 1, i_theta_M1); \ + const int right = grid_.index(i_r + 1, i_theta); \ + const int top_right = grid_.index(i_r + 1, i_theta_P1); \ + \ + result[center] = \ + rhs[center] - \ + (0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) * x[center] /* beta_{i,j} */ \ + \ + - coeff1 * (arr[center] + arr[left]) * (x[left] - x[center]) /* Left - Center: (Left) */ \ + - coeff2 * (arr[center] + arr[right]) * (x[right] - x[center]) /* Right - Center: (Right) */ \ + - coeff3 * (att[center] + att[bottom]) * (x[bottom] - x[center]) /* Bottom - Center: (Bottom) */ \ + - coeff4 * (att[center] + att[top]) * (x[top] - x[center]) /* Top - Center: (Top) */ \ + \ + /* - 0.25 * (art[left] + art[bottom]) * x[bottom_left] // Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + \ + /* + 0.25 * (art[left] + art[top]) * x[top_left] // Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + /* ----------------------------- */ \ + /* Node on to the outer boundary */ \ + /* ----------------------------- */ \ + } \ + else if (i_r == grid.nr() - 1) { \ + /* Fill result of (i,j) */ \ + const int center = grid.index(i_r, i_theta); \ + result[center] = rhs[center] - x[center]; \ + } \ + } while (0) + +void ResidualTake::applyCircleSection(const int i_r, Vector& result, const Vector& rhs, + const Vector& x) const +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + NODE_APPLY_RESIDUAL_TAKE(i_r, i_theta, grid_, DirBC_Interior_, result, rhs, x, arr, att, art, detDF, + coeff_beta); + } +} + +void ResidualTake::applyRadialSection(const int i_theta, Vector& result, const Vector& rhs, + const Vector& x) const +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + NODE_APPLY_RESIDUAL_TAKE(i_r, i_theta, grid_, DirBC_Interior_, result, rhs, x, arr, att, art, detDF, + coeff_beta); + } +} \ No newline at end of file diff --git a/src/Residual/ResidualTake/residualTake.cpp b/src/Residual/ResidualTake/residualTake.cpp new file mode 100644 index 00000000..84323cc8 --- /dev/null +++ b/src/Residual/ResidualTake/residualTake.cpp @@ -0,0 +1,48 @@ +#include "../../../include/Residual/ResidualTake/residualTake.h" + +ResidualTake::ResidualTake(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : Residual(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ +} + +/* ------------------ */ +/* result = rhs - A*x */ + +// clang-format off +void ResidualTake::computeResidual(Vector& result, const Vector& rhs, const Vector& x) const +{ + assert(result.size() == x.size()); + omp_set_num_threads(num_omp_threads_); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + applyCircleSection(i_r, result, rhs, x); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyRadialSection(i_theta, result, rhs, x); + } + } + else { + /* Multi-threaded execution */ + #pragma omp parallel + { + /* Circle Section */ + #pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + applyCircleSection(i_r, result, rhs, x); + } + /* Radial Section */ + #pragma omp for nowait + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyRadialSection(i_theta, result, rhs, x); + } + } + } +} +// clang-format on \ No newline at end of file diff --git a/src/Residual/residual.cpp b/src/Residual/residual.cpp new file mode 100644 index 00000000..9eaccb99 --- /dev/null +++ b/src/Residual/residual.cpp @@ -0,0 +1,13 @@ +#include "../../include/Residual/residual.h" + +Residual::Residual(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : grid_(grid) + , level_cache_(level_cache) + , domain_geometry_(domain_geometry) + , density_profile_coefficients_(density_profile_coefficients) + , DirBC_Interior_(DirBC_Interior) + , num_omp_threads_(num_omp_threads) +{ +} diff --git a/src/Smoother/SmootherGive/buildMatrix.cpp b/src/Smoother/SmootherGive/buildMatrix.cpp new file mode 100644 index 00000000..b2875150 --- /dev/null +++ b/src/Smoother/SmootherGive/buildMatrix.cpp @@ -0,0 +1,839 @@ +#include "../../../include/Smoother/SmootherGive/smootherGive.h" + +#include "../../../include/common/geometry_helper.h" + +/* Tridiagonal matrices */ +#define UPDATE_MATRIX_ELEMENT(matrix, row, column, value) \ + do { \ + if (row == column) \ + matrix.main_diagonal(row) += value; \ + else if (row == column - 1) \ + matrix.sub_diagonal(row) += value; \ + else if (row == 0 && column == matrix.columns() - 1) \ + matrix.cyclic_corner_element() += value; \ + } while (0) + +/* Inner Boundary COO/CSR matrix */ +#ifdef GMGPOLAR_USE_MUMPS + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_index(ptr + offset) = row; \ + matrix.col_index(ptr + offset) = col; \ + matrix.value(ptr + offset) += val; \ + } while (0) +#else + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_nz_index(row, offset) = col; \ + matrix.row_nz_entry(row, offset) += val; \ + } while (0) +#endif + +#define NODE_BUILD_SMOOTHER_GIVE(i_r, i_theta, grid, DirBC_Interior, inner_boundary_circle_matrix, \ + circle_tridiagonal_solver, radial_tridiagonal_solver) \ + do { \ + assert(i_r >= 0 && i_r < grid.nr()); \ + assert(i_theta >= 0 && i_theta < grid.ntheta()); \ + \ + const int numberSmootherCircles = grid.numberSmootherCircles(); \ + const int lengthSmootherRadial = grid.lengthSmootherRadial(); \ + \ + assert(numberSmootherCircles >= 2); \ + assert(lengthSmootherRadial >= 3); \ + \ + int ptr, offset; \ + int row, column, col; \ + double value, val; \ + \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Circle Section */ \ + /* ------------------------------------------ */ \ + if (i_r > 0 && i_r < numberSmootherCircles) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int center_index = i_theta; \ + const int left_index = i_theta; \ + const int right_index = (i_r + 1 == numberSmootherCircles) ? 0 : i_theta; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + /* Visualization of the sourrounding tridiagonal matrices. */ \ + /* left_matrix, center_matrix, right_matrix */ \ + /* | O | O | O | */ \ + /* | | | | */ \ + /* | O | Õ | O | */ \ + /* | | | | */ \ + /* | O | O | O | */ \ + /* or */ \ + /* left_matrix, right_matrix */ \ + /* | O | O | O || O O O O */ \ + /* | | | || -------------- */ \ + /* | O | O | Õ || O O O O <- right_matrix */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O */ \ + auto& left_matrix = circle_tridiagonal_solver[i_r - 1]; \ + auto& center_matrix = circle_tridiagonal_solver[i_r]; \ + auto& right_matrix = (i_r + 1 == numberSmootherCircles) ? radial_tridiagonal_solver[i_theta] \ + : circle_tridiagonal_solver[i_r + 1]; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = bottom_index; \ + value = -coeff3 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = top_index; \ + value = -coeff4 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = center_index; \ + value = -coeff3 * att; /* Top */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = center_index; \ + value = -coeff4 * att; /* Bottom */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + if (!DirBC_Interior && i_r == 1) { \ + row = left_index; \ + ptr = getCircleAscIndex(i_r - 1, i_theta); \ + \ + const Stencil& LeftStencil = getStencil(i_r - 1); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + } \ + if (i_r > 1) { \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(left_matrix, row, column, value); \ + } \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(right_matrix, row, column, value); \ + } \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Radial Section */ \ + /* ------------------------------------------ */ \ + else if (i_r > numberSmootherCircles && i_r < grid.nr() - 2) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + /* ---------- */ \ + /* O O O <- top_matrix */ \ + /* ---------- */ \ + /* O Õ O <- center_matrix */ \ + /* ---------- */ \ + /* O O O <- bottom_matrix */ \ + /* ---------- */ \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1]; \ + auto& center_matrix = radial_tridiagonal_solver[i_theta]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1]; \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + const int bottom_index = i_r - numberSmootherCircles; \ + const int top_index = i_r - numberSmootherCircles; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = center_index; \ + value = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = center_index; \ + value = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(top_matrix, row, column, value); \ + } \ + /* ------------------------------------------ */ \ + /* Circle Section: Node in the inner boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + /* Fill result(i,j) */ \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + auto& center_matrix = inner_boundary_circle_matrix; \ + auto& right_matrix = circle_tridiagonal_solver[i_r + 1]; \ + \ + const int center_index = i_theta; \ + const int right_index = i_theta; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = getCircleAscIndex(i_r, i_theta); \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(right_matrix, row, column, value); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()>>1)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + const double h1 = 2 * grid.radius(0); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + /* left_matrix (across-the origin), center_matrix, right_matrix */ \ + /* -| X | O | X | */ \ + /* -| | | | */ \ + /* -| Õ | O | O | */ \ + /* -| | | | */ \ + /* -| X | O | X | */ \ + auto& center_matrix = inner_boundary_circle_matrix; \ + auto& right_matrix = circle_tridiagonal_solver[i_r + 1]; \ + auto& left_matrix = inner_boundary_circle_matrix; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + grid.ntheta() / 2); \ + \ + const int center_index = i_theta; \ + const int left_index = i_theta_AcrossOrigin; \ + const int right_index = i_theta; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + const int center_nz_index = getCircleAscIndex(i_r, i_theta); \ + const int bottom_nz_index = getCircleAscIndex(i_r, i_theta_M1); \ + const int top_nz_index = getCircleAscIndex(i_r, i_theta_P1); \ + const int left_nz_index = getCircleAscIndex(i_r, i_theta_AcrossOrigin); \ + \ + int nz_index; \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* beta_{i,j} */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = -coeff1 * arr; /* Left */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = -coeff3 * att; /* Bottom */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = -coeff4 * att; /* Top */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + /* Fill matrix row of (i-1,j) */ \ + /* From view the view of the across origin node, */ \ + /* the directions are roatated by 180 degrees in the stencil! */ \ + row = left_index; \ + ptr = left_nz_index; \ + \ + const Stencil& LeftStencil = CenterStencil; \ + \ + offset = LeftStencil[StencilPosition::Left]; \ + col = center_index; \ + val = -coeff1 * arr; /* Right -> Left*/ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = LeftStencil[StencilPosition::Center]; \ + col = left_index; \ + val = +coeff1 * arr; /* Center: (Right) -> Center: (Left) */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + /* Top Right -> Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Bottom Right -> Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(right_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + ptr = bottom_nz_index; \ + \ + const Stencil& BottomStencil = CenterStencil; \ + \ + offset = BottomStencil[StencilPosition::Top]; \ + col = center_index; \ + val = -coeff3 * att; /* Top */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = BottomStencil[StencilPosition::Center]; \ + col = bottom_index; \ + val = +coeff3 * att; /* Center: (Top) */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + /* TopLeft: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + ptr = top_nz_index; \ + \ + const Stencil& TopStencil = CenterStencil; \ + \ + offset = TopStencil[StencilPosition::Bottom]; \ + col = center_index; \ + val = -coeff4 * att; /* Bottom */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + offset = TopStencil[StencilPosition::Center]; \ + col = top_index; \ + val = +coeff4 * att; /* Center: (Bottom) */ \ + COO_CSR_UPDATE(inner_boundary_circle_matrix, ptr, offset, row, col, val); \ + \ + /* BottomLeft: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + } \ + } \ + /* --------------------------------------------- */ \ + /* Radial Section: Node next to circular section */ \ + /* --------------------------------------------- */ \ + else if (i_r == numberSmootherCircles) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + /* | O | O | O || O O O O <- top_matrix */ \ + /* | | | || -------------- */ \ + /* | O | O | O || Õ O O O <- center_matrix */ \ + /* | | | || -------------- */ \ + /* | O | O | O || O O O O <- bottom_matrix */ \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1]; \ + auto& center_matrix = radial_tridiagonal_solver[i_theta]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1]; \ + auto& left_matrix = circle_tridiagonal_solver[i_r - 1]; \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_theta; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + const int bottom_index = i_r - numberSmootherCircles; \ + const int top_index = i_r - numberSmootherCircles; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(left_matrix, row, column, value); \ + \ + /* Fill matrix row of (i+1,j) */ \ + row = right_index; \ + column = center_index; \ + value = -coeff2 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = right_index; \ + column = right_index; \ + value = coeff2 * arr; /* Center: (Left) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(top_matrix, row, column, value); \ + } \ + /* ------------------------------------------- */ \ + /* Radial Section: Node next to outer boundary */ \ + /* ------------------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + const double h1 = grid.radialSpacing(i_r - 1); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + /* ---------------|| */ \ + /* O O O O || <- top_matrix */ \ + /* ---------------|| */ \ + /* O O Õ O || <- center_matrix */ \ + /* ---------------|| */ \ + /* O O O O || <- bottom_matrix */ \ + /* ---------------|| */ \ + auto& bottom_matrix = radial_tridiagonal_solver[i_theta_M1]; \ + auto& center_matrix = radial_tridiagonal_solver[i_theta]; \ + auto& top_matrix = radial_tridiagonal_solver[i_theta_P1]; \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + const int bottom_index = i_r - numberSmootherCircles; \ + const int top_index = i_r - numberSmootherCircles; \ + \ + /* ---------------------------- */ \ + /* Give values to center matrix */ \ + /* ---------------------------- */ \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta * fabs(detDF); /* Center: beta_{i,j} */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * arr; /* Left */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = center_index; \ + column = center_index; \ + value = (coeff1 + coeff2) * arr + (coeff3 + coeff4) * att; /* Center: (Left, Right, Bottom, Top) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = center_index; \ + value = -coeff1 * arr; /* Right */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j-1) */ \ + row = bottom_index; \ + column = bottom_index; \ + value = coeff3 * att; /* Center: (Top) */ \ + UPDATE_MATRIX_ELEMENT(bottom_matrix, row, column, value); \ + \ + /* Fill matrix row of (i,j+1) */ \ + row = top_index; \ + column = top_index; \ + value = coeff4 * att; /* Center: (Bottom) */ \ + UPDATE_MATRIX_ELEMENT(top_matrix, row, column, value); \ + } \ + /* ------------------------------------------ */ \ + /* Radial Section: Node on the outer boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + /* O O Õ || <- center_matrix*/ \ + /* -----------|| */ \ + /* O O O || */ \ + /* -----------|| */ \ + auto& center_matrix = radial_tridiagonal_solver[i_theta]; \ + \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + \ + /* Fill matrix row of (i-1,j) */ \ + row = left_index; \ + column = left_index; \ + value = coeff1 * arr; /* Center: (Right) */ \ + UPDATE_MATRIX_ELEMENT(center_matrix, row, column, value); \ + } \ + } while (0) + +void SmootherGive::buildAscCircleSection(const int i_r) +{ + const double r = grid_.radius(i_r); + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const int global_index = grid_.index(i_r, i_theta); + const double theta = grid_.theta(i_theta); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build Asc at the current node + NODE_BUILD_SMOOTHER_GIVE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_tridiagonal_solver_, radial_tridiagonal_solver_); + } +} + +void SmootherGive::buildAscRadialSection(const int i_theta) +{ + const double theta = grid_.theta(i_theta); + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + const int global_index = grid_.index(i_r, i_theta); + const double r = grid_.radius(i_r); + + double sin_theta, cos_theta; + double coeff_beta, arr, att, art, detDF; + level_cache_.obtainValues(i_r, i_theta, global_index, r, theta, sin_theta, cos_theta, coeff_beta, arr, att, art, + detDF); + + // Build Asc at the current node + NODE_BUILD_SMOOTHER_GIVE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_tridiagonal_solver_, radial_tridiagonal_solver_); + } +} + +// clang-format off +void SmootherGive::buildAscMatrices() +{ + omp_set_num_threads(num_omp_threads_); + + /* -------------------------------------- */ + /* Part 1: Allocate Asc Smoother matrices */ + /* -------------------------------------- */ + + const int number_smoother_circles = grid_.numberSmootherCircles(); + const int length_smoother_radial = grid_.lengthSmootherRadial(); + + const int num_circle_nodes = grid_.ntheta(); + circle_tridiagonal_solver_.resize(number_smoother_circles); + + const int num_radial_nodes = length_smoother_radial; + radial_tridiagonal_solver_.resize(grid_.ntheta()); + + // Remark: circle_tridiagonal_solver_[0] is unitialized. + // Please use inner_boundary_circle_matrix_ instead! + #pragma omp parallel if (grid_.numberOfNodes() > 10'000) + { + // ---------------- // + // Circular Section // + #pragma omp for nowait + for (int circle_Asc_index = 0; circle_Asc_index < number_smoother_circles; circle_Asc_index++) { + + /* Inner boundary circle */ + if (circle_Asc_index == 0) { + #ifdef GMGPOLAR_USE_MUMPS + // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. + const int nnz = getNonZeroCountCircleAsc(circle_Asc_index); + inner_boundary_circle_matrix_ = SparseMatrixCOO(num_circle_nodes, num_circle_nodes, nnz); + inner_boundary_circle_matrix_.is_symmetric(false); + for (int i = 0; i < nnz; i++) { + inner_boundary_circle_matrix_.value(i) = 0.0; + } + #else + std::function nnz_per_row = [&](int i_theta) { + return DirBC_Interior_? 1 : 4; + }; + inner_boundary_circle_matrix_ = SparseMatrixCSR(num_circle_nodes, num_circle_nodes, nnz_per_row); + for (int i = 0; i < inner_boundary_circle_matrix_.non_zero_size(); i++) { + inner_boundary_circle_matrix_.values_data()[i] = 0.0; + } + #endif + } + + /* Interior Circle Section */ + else { + auto& solverMatrix = circle_tridiagonal_solver_[circle_Asc_index]; + + solverMatrix = SymmetricTridiagonalSolver(num_circle_nodes); + solverMatrix.is_cyclic(true); + solverMatrix.cyclic_corner_element() = 0.0; + + for (int i = 0; i < num_circle_nodes; i++) { + solverMatrix.main_diagonal(i) = 0.0; + if (i < num_circle_nodes - 1) { + solverMatrix.sub_diagonal(i) = 0.0; + } + } + } + } + + // -------------- // + // Radial Section // + #pragma omp for nowait + for (int radial_Asc_index = 0; radial_Asc_index < grid_.ntheta(); radial_Asc_index++) { + auto& solverMatrix = radial_tridiagonal_solver_[radial_Asc_index]; + + solverMatrix = SymmetricTridiagonalSolver(num_radial_nodes); + solverMatrix.is_cyclic(false); + + for (int i = 0; i < num_radial_nodes; i++) { + solverMatrix.main_diagonal(i) = 0.0; + if (i < num_radial_nodes - 1) { + solverMatrix.sub_diagonal(i) = 0.0; + } + } + } + } + + /* ---------------------------------- */ + /* Part 2: Fill Asc Smoother matrices */ + /* ---------------------------------- */ + + if (omp_get_max_threads() == 1) { + /* Single-threaded execution */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildAscCircleSection(i_r); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildAscRadialSection(i_theta); + } + } + else { + /* Multi-threaded execution: For Loops */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int additional_radial_tasks = grid_.ntheta() % 3; + const int num_radial_tasks = grid_.ntheta() - additional_radial_tasks; + + #pragma omp parallel + { + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildAscCircleSection(i_r); + } + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildAscCircleSection(i_r); + } + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 3) { + int i_r = grid_.numberSmootherCircles() - circle_task - 1; + buildAscCircleSection(i_r); + } + + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 0) { + int i_theta = radial_task + additional_radial_tasks; + buildAscRadialSection(i_theta); + } + else { + if (additional_radial_tasks == 0) { + buildAscRadialSection(0); + } + else if (additional_radial_tasks >= 1) { + buildAscRadialSection(0); + buildAscRadialSection(1); + } + } + } + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 3) { + if (radial_task > 1) { + int i_theta = radial_task + additional_radial_tasks; + buildAscRadialSection(i_theta); + } + else { + if (additional_radial_tasks == 0) { + buildAscRadialSection(1); + } + else if (additional_radial_tasks == 1) { + buildAscRadialSection(2); + } + else if (additional_radial_tasks == 2) { + buildAscRadialSection(2); + buildAscRadialSection(3); + } + } + } + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 3) { + int i_theta = radial_task + additional_radial_tasks; + buildAscRadialSection(i_theta); + } + } + } + + #ifdef GMGPOLAR_USE_MUMPS + /* ------------------------------------------------------------------ */ + /* Part 3: Convert inner_boundary_circle_matrix to a symmetric matrix */ + /* ------------------------------------------------------------------ */ + + SparseMatrixCOO full_matrix = std::move(inner_boundary_circle_matrix_); + + const int nnz = full_matrix.non_zero_size(); + const int numRows = full_matrix.rows(); + const int numColumns = full_matrix.columns(); + const int symmetric_nnz = nnz - (nnz - numRows) / 2; + + inner_boundary_circle_matrix_ = SparseMatrixCOO(numRows, numColumns, symmetric_nnz); + inner_boundary_circle_matrix_.is_symmetric(true); + + int current_nz = 0; + for (int nz_index = 0; nz_index < full_matrix.non_zero_size(); nz_index++) { + int current_row = full_matrix.row_index(nz_index); + int current_col = full_matrix.col_index(nz_index); + if (current_row <= current_col) { + inner_boundary_circle_matrix_.row_index(current_nz) = current_row; + inner_boundary_circle_matrix_.col_index(current_nz) = current_col; + inner_boundary_circle_matrix_.value(current_nz) = std::move(full_matrix.value(nz_index)); + current_nz++; + } + } + #endif +} +// clang-format on \ No newline at end of file diff --git a/src/Smoother/SmootherGive/initializeMumps.cpp b/src/Smoother/SmootherGive/initializeMumps.cpp new file mode 100644 index 00000000..a8aa196c --- /dev/null +++ b/src/Smoother/SmootherGive/initializeMumps.cpp @@ -0,0 +1,111 @@ +#include "../../../include/Smoother/SmootherGive/smootherGive.h" + +#ifdef GMGPOLAR_USE_MUMPS + +void SmootherGive::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix) +{ + /* + * MUMPS (a parallel direct solver) uses 1-based indexing, + * whereas the input matrix follows 0-based indexing. + * Adjust row and column indices to match MUMPS' requirements. + */ + for (int i = 0; i < solver_matrix.non_zero_size(); i++) { + solver_matrix.row_index(i) += 1; + solver_matrix.col_index(i) += 1; + } + + mumps_solver.job = JOB_INIT; + mumps_solver.par = PAR_PARALLEL; + /* The matrix is positive definite for invertible mappings. */ + /* Therefore we use SYM_POSITIVE_DEFINITE instead of SYM_GENERAL_SYMMETRIC. */ + mumps_solver.sym = (solver_matrix.is_symmetric() ? SYM_POSITIVE_DEFINITE : SYM_UNSYMMETRIC); + mumps_solver.comm_fortran = USE_COMM_WORLD; + dmumps_c(&mumps_solver); + + mumps_solver.ICNTL(1) = 0; // Output stream for error messages. + mumps_solver.ICNTL(2) = 0; // Output stream for diagnostic printing and statistics local to each MPI process. + mumps_solver.ICNTL(3) = 0; // Output stream for global information, collected on the host + mumps_solver.ICNTL(4) = 0; // Level of printing for error, warning, and diagnostic messages. + mumps_solver.ICNTL(5) = 0; // Controls the matrix input format + mumps_solver.ICNTL(6) = 7; // Permutes the matrix to a zero-free diagonal and/or scale the matrix + mumps_solver.ICNTL(7) = + 5; // Computes a symmetric permutation (ordering) to determine the pivot order to be used for the factorization in case of sequential analysis + mumps_solver.ICNTL(8) = 77; // Describes the scaling strategy + mumps_solver.ICNTL(9) = 1; // Computes the solution using A or A^T + mumps_solver.ICNTL(10) = 0; // Applies the iterative refinement to the computed solution + mumps_solver.ICNTL(11) = 0; // Computes statistics related to an error analysis of the linear system solved + mumps_solver.ICNTL(12) = 0; // Defines an ordering strategy for symmetric matrices and is used + mumps_solver.ICNTL(13) = 0; // Controls the parallelism of the root node + mumps_solver.ICNTL(14) = // Controls the percentage increase in the estimated working space + (solver_matrix.is_symmetric() ? 5 : 20); + mumps_solver.ICNTL(15) = 0; // Exploits compression of the input matrix resulting from a block format + mumps_solver.ICNTL(16) = 0; // Controls the setting of the number of OpenMP threads + // ICNTL(17) Doesn't exist + mumps_solver.ICNTL(18) = 0; // Defines the strategy for the distributed input matrix + mumps_solver.ICNTL(19) = 0; // Computes the Schur complement matrix + mumps_solver.ICNTL(20) = 0; // Determines the format (dense, sparse, or distributed) of the right-hand sides + mumps_solver.ICNTL(21) = 0; // Determines the distribution (centralized or distributed) of the solution vectors. + mumps_solver.ICNTL(22) = 0; // Controls the in-core/out-of-core (OOC) factorization and solve. + mumps_solver.ICNTL(23) = 0; // Corresponds to the maximum size of the working memory in MegaBytes that MUMPS can + // allocate per working process + mumps_solver.ICNTL(24) = 0; // Controls the detection of “null pivot rows”. + mumps_solver.ICNTL(25) = + 0; // Allows the computation of a solution of a deficient matrix and also of a null space basis + mumps_solver.ICNTL(26) = 0; // Drives the solution phase if a Schur complement matrix has been computed + mumps_solver.ICNTL(27) = -32; // Controls the blocking size for multiple right-hand sides. + mumps_solver.ICNTL(28) = 0; // Determines whether a sequential or parallel computation of the ordering is performed + mumps_solver.ICNTL(29) = + 0; // Defines the parallel ordering tool (when ICNTL(28)=1) to be used to compute the fill-in reducing permutation. + mumps_solver.ICNTL(30) = 0; // Computes a user-specified set of entries in the inverse A^−1 of the original matrix + mumps_solver.ICNTL(31) = 0; // Indicates which factors may be discarded during the factorization. + mumps_solver.ICNTL(32) = 0; // Performs the forward elimination of the right-hand sides during the factorization + mumps_solver.ICNTL(33) = 0; // Computes the determinant of the input matrix. + mumps_solver.ICNTL(34) = 0; // Controls the conservation of the OOC files during JOB= –3 + mumps_solver.ICNTL(35) = 0; // Controls the activation of the BLR feature + mumps_solver.ICNTL(36) = 0; // Controls the choice of BLR factorization variant + mumps_solver.ICNTL(37) = 0; // Controls the BLR compression of the contribution blocks + mumps_solver.ICNTL(38) = 600; // Estimates compression rate of LU factors + mumps_solver.ICNTL(39) = 500; // Estimates compression rate of contribution blocks + // ICNTL(40-47) Don't exist + mumps_solver.ICNTL(48) = 1; // Multithreading with tree parallelism + mumps_solver.ICNTL(49) = 0; // Compact workarray id%S at the end of factorization phase + // ICNTL(50-55) Don't exist + mumps_solver.ICNTL(56) = + 0; // Detects pseudo-singularities during factorization and factorizes the root node with a rankrevealing method + // ICNTL(57) Doesn't exist + mumps_solver.ICNTL(58) = 2; // Defines options for symbolic factorization + // ICNTL(59-60) Don't exist + + mumps_solver.CNTL(1) = -1.0; // Relative threshold for numerical pivoting + mumps_solver.CNTL(2) = -1.0; // Stopping criterion for iterative refinement + mumps_solver.CNTL(3) = 0.0; // Determine null pivot rows + mumps_solver.CNTL(4) = -1.0; // Determines the threshold for static pivoting + mumps_solver.CNTL(5) = + 0.0; // Defines the fixation for null pivots and is effective only when null pivot row detection is active + // CNTL(6) Doesn't exist + mumps_solver.CNTL(7) = 0.0; // Defines the precision of the dropping parameter used during BLR compression + // CNTL(8-15) Don't exist + + mumps_solver.job = JOB_ANALYSIS_AND_FACTORIZATION; + assert(solver_matrix.rows() == solver_matrix.columns()); + mumps_solver.n = solver_matrix.rows(); + mumps_solver.nz = solver_matrix.non_zero_size(); + mumps_solver.irn = solver_matrix.row_indices_data(); + mumps_solver.jcn = solver_matrix.column_indices_data(); + mumps_solver.a = solver_matrix.values_data(); + dmumps_c(&mumps_solver); + + if (mumps_solver.sym == SYM_POSITIVE_DEFINITE && mumps_solver.INFOG(12) != 0) { + std::cout << "Warning: Smoother inner boundary matrix is not positive definite: Negative pivots in the " + "factorization phase." + << std::endl; + } +} + +void SmootherGive::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +{ + mumps_solver.job = JOB_END; + dmumps_c(&mumps_solver); +} + +#endif \ No newline at end of file diff --git a/src/Smoother/SmootherGive/matrixStencil.cpp b/src/Smoother/SmootherGive/matrixStencil.cpp new file mode 100644 index 00000000..9fb62fea --- /dev/null +++ b/src/Smoother/SmootherGive/matrixStencil.cpp @@ -0,0 +1,118 @@ +#include "../../../include/Smoother/SmootherGive/smootherGive.h" + +const Stencil& SmootherGive::getStencil(int i_r) const +{ + + assert(0 <= i_r && i_r < grid_.nr()); + + assert(grid_.numberSmootherCircles() >= 2); + assert(grid_.lengthSmootherRadial() >= 3); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + if (i_r < numberSmootherCircles) { + /* Circle Section */ + if (i_r > 0 && i_r < numberSmootherCircles) { + return circle_stencil_interior_; + } + else if (i_r == 0) { + return DirBC_Interior_ ? stencil_DB_ : circle_stencil_across_origin_; + } + } + else { + /* Radial Section */ + if (i_r > numberSmootherCircles && i_r < grid_.nr() - 2) { + return radial_stencil_interior_; + } + else if (i_r == numberSmootherCircles) { + return radial_stencil_next_circular_smoothing_; + } + else if (i_r == grid_.nr() - 1) { + return stencil_DB_; + } + else if (i_r == grid_.nr() - 2) { + return radial_stencil_next_outer_DB_; + } + } + throw std::out_of_range("Invalid index for stencil"); +} + +int SmootherGive::getNonZeroCountCircleAsc(const int i_r) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 4; + const int size_stencil_interior = 3; + + if (i_r > 0) { + return size_stencil_interior * grid_.ntheta(); + } + else if (i_r == 0) { + return size_stencil_inner_boundary * grid_.ntheta(); + } + throw std::out_of_range("Invalid index for nnz_circle_Asc"); +} + +int SmootherGive::getCircleAscIndex(const int i_r, const int i_theta) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 4; + const int size_stencil_interior = 3; + + if (i_r > 0) { + return size_stencil_interior * i_theta; + } + else { + return size_stencil_inner_boundary * i_theta; + } +} + +int SmootherGive::getNonZeroCountRadialAsc(const int i_theta) const +{ + assert(i_theta >= 0 && i_theta < grid_.ntheta()); + + const int size_stencil_next_circluar_smoothing = 2; + const int size_stencil_interior = 3; + const int size_stencil_next_outer_boundary = 2; + const int size_stencil_outer_boundary = 1; + + assert(grid_.lengthSmootherRadial() >= 3); + + return size_stencil_next_circluar_smoothing + (grid_.lengthSmootherRadial() - 3) * size_stencil_interior + + size_stencil_next_outer_boundary + size_stencil_outer_boundary; +} + +int SmootherGive::getRadialAscIndex(const int i_r, const int i_theta) const +{ + assert(i_theta >= 0 && i_theta < grid_.ntheta()); + + const int size_stencil_next_circluar_smoothing = 2; + const int size_stencil_interior = 3; + const int size_stencil_next_outer_boundary = 2; + const int size_stencil_outer_boundary = 1; + + assert(grid_.lengthSmootherRadial() >= 3); + assert(grid_.numberSmootherCircles() >= 2); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + if (i_r > numberSmootherCircles && i_r < grid_.nr() - 2) { + return size_stencil_next_circluar_smoothing + (i_r - numberSmootherCircles - 1) * size_stencil_interior; + } + else if (i_r == numberSmootherCircles) { + return 0; + } + else if (i_r == grid_.nr() - 2) { + return size_stencil_next_circluar_smoothing + (grid_.lengthSmootherRadial() - 3) * size_stencil_interior; + } + else if (i_r == grid_.nr() - 1) { + return size_stencil_next_circluar_smoothing + (grid_.lengthSmootherRadial() - 3) * size_stencil_interior + + size_stencil_next_outer_boundary; + } + throw std::out_of_range("Invalid index for stencil"); +} diff --git a/src/Smoother/SmootherGive/smootherGive.cpp b/src/Smoother/SmootherGive/smootherGive.cpp new file mode 100644 index 00000000..ebc915ec --- /dev/null +++ b/src/Smoother/SmootherGive/smootherGive.cpp @@ -0,0 +1,28 @@ +#include "../../../include/Smoother/SmootherGive/smootherGive.h" + +SmootherGive::SmootherGive(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : Smoother(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ + buildAscMatrices(); +#ifdef GMGPOLAR_USE_MUMPS + initializeMumpsSolver(inner_boundary_mumps_solver_, inner_boundary_circle_matrix_); +#else + inner_boundary_lu_solver_ = SparseLUSolver(inner_boundary_circle_matrix_); +#endif +} + +SmootherGive::~SmootherGive() +{ +#ifdef GMGPOLAR_USE_MUMPS + finalizeMumpsSolver(inner_boundary_mumps_solver_); +#endif +} + +void SmootherGive::smoothing(Vector& x, const Vector& rhs, Vector& temp) +{ + smoothingForLoop(x, rhs, temp); /* This is the fastest option */ + // smoothingTaskLoop(x, rhs, temp); + // smoothingTaskDependencies(x, rhs, temp); +} diff --git a/src/Smoother/SmootherGive/smootherSolver.cpp b/src/Smoother/SmootherGive/smootherSolver.cpp new file mode 100644 index 00000000..030ff99d --- /dev/null +++ b/src/Smoother/SmootherGive/smootherSolver.cpp @@ -0,0 +1,678 @@ +#include "../../../include/Smoother/SmootherGive/smootherGive.h" + +#include "../../../include/common/geometry_helper.h" + +#define NODE_APPLY_ASC_ORTHO_CIRCLE_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, \ + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta) \ + do { \ + assert(i_r >= 0 && i_r <= grid_.numberSmootherCircles()); \ + bool isOddNumberSmootherCircles = (grid.numberSmootherCircles() & 1); \ + bool isOddRadialIndex = (i_r & 1); \ + SmootherColor node_color = \ + (isOddNumberSmootherCircles == isOddRadialIndex) ? SmootherColor::White : SmootherColor::Black; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > 0 && i_r < grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + ); \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= (-0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (+0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i-1,j) */ \ + if (i_r > 1 || !DirBC_Interior) { \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + /* Fill temp(i+1,j) */ \ + if (i_r < grid.numberSmootherCircles() - 1) { \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + } \ + /* -------------------- */ \ + /* Node on the boundary */ \ + /* -------------------- */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + if (DirBC_Interior) { \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= \ + (/* - coeff1 * arr * x[grid.index(i_r, i_theta + (grid.ntheta()/2))] // Left: Not in Asc_ortho */ \ + -coeff2 * arr * x[grid.index(i_r + 1, i_theta)] /* Right */ \ + ); \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= \ + (-0.25 * art * x[grid.index(i_r + 1, i_theta)]); /* Top Right */ \ + /* + 0.25 * art * x[grid.index(i_r-1,i_theta)]; // Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (+0.25 * art * x[grid.index(i_r + 1, i_theta)]); /* Bottom Right */ \ + /* - 0.25 * art * x[grid.index(i_r-1,i_theta)]; // Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + } \ + } \ + /* ----------------------------- */ \ + /* Node next to circular section */ \ + /* ----------------------------- */ \ + else if (i_r == grid.numberSmootherCircles()) { \ + assert(node_color == SmootherColor::White); \ + if (smoother_color == SmootherColor::Black) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-coeff1 * arr * x[grid.index(i_r, i_theta)] /* Right */ \ + - 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + } \ + } \ + } while (0) + +#define NODE_APPLY_ASC_ORTHO_RADIAL_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid, DirBC_Interior, \ + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta) \ + do { \ + assert(i_r >= grid.numberSmootherCircles() - 1 && i_r < grid.nr()); \ + SmootherColor node_color = (i_theta & 1) ? SmootherColor::White : SmootherColor::Black; \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > grid.numberSmootherCircles() && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= (-coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (+0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + else if (i_r == grid.numberSmootherCircles() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (-coeff2 * arr * x[grid.index(i_r, i_theta)] /* Left */ \ + + 0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Nothing to be done here */ \ + } \ + } \ + else if (i_r == grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= (-coeff1 * arr * x[grid.index(i_r - 1, i_theta)] /* Left */ \ + - coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i+1,j) */ \ + temp[grid.index(i_r + 1, i_theta)] -= \ + (+0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Left */ \ + - 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Left */ \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + else if (i_r == grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i,j) */ \ + temp[grid.index(i_r, i_theta)] -= (-coeff3 * att * x[grid.index(i_r, i_theta - 1)] /* Bottom */ \ + - coeff4 * att * x[grid.index(i_r, i_theta + 1)] /* Top */ \ + ); \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)]); /* Bottom Right */ \ + \ + /* "Right" is part of the radial Asc smoother matrices, */ \ + /* but is shifted over to the rhs to make the radial Asc smoother matrices symmetric. */ \ + /* Note that the circle Asc smoother matrices are symmetric by default. */ \ + /* Note that rhs[grid.index(i_r + 1, i_theta)] contains the correct boundary value of u_D. */ \ + temp[grid.index(i_r, i_theta)] -= /* Right: Symmetry shift! */ \ + -coeff2 * arr * rhs[grid.index(i_r + 1, i_theta)]; \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Fill temp(i,j-1) */ \ + temp[grid.index(i_r, i_theta - 1)] -= (-coeff3 * att * x[grid.index(i_r, i_theta)] /* Top */ \ + - 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Top Left */ \ + /* Fill temp(i,j+1) */ \ + temp[grid.index(i_r, i_theta + 1)] -= \ + (-coeff4 * att * x[grid.index(i_r, i_theta)] /* Bottom */ \ + + 0.25 * art * x[grid.index(i_r + 1, i_theta)] /* Bottom Right */ \ + - 0.25 * art * x[grid.index(i_r - 1, i_theta)]); /* Bottom Left */ \ + } \ + } \ + else if (i_r == grid.nr() - 1) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + /* -------------------- */ \ + /* Inside Section Parts */ \ + if (node_color == smoother_color) { \ + /* Fill temp(i-1,j) */ \ + temp[grid.index(i_r - 1, i_theta)] -= \ + (-0.25 * art * x[grid.index(i_r, i_theta + 1)] /* Top Right */ \ + + 0.25 * art * x[grid.index(i_r, i_theta - 1)] /* Bottom Right */ \ + ); \ + /* "Right" is part of the radial Asc smoother matrices, */ \ + /* but is shifted over to the rhs to make the radial Asc smoother matrices symmetric. */ \ + /* Note that the circle Asc smoother matrices are symmetric by default. */ \ + /* Note that rhs[grid.index(i_r, i_theta)] contains the correct boundary value of u_D. */ \ + temp[grid.index(i_r - 1, i_theta)] -= (-coeff1 * arr * rhs[grid.index(i_r, i_theta)] /* Right */ \ + ); \ + } \ + /* --------------------- */ \ + /* Outside Section Parts */ \ + else if (node_color != smoother_color) { \ + /* Nothing to be done here */ \ + } \ + } \ + } while (0) + +void SmootherGive::applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, Vector& temp) +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles() + 1); + + const auto& sin_theta_cache = level_cache_.sin_theta(); + const auto& cos_theta_cache = level_cache_.cos_theta(); + + const double r = grid_.radius(i_r); + + double coeff_beta; + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_beta = level_cache_.coeff_beta()[i_r]; + } + else { + coeff_beta = density_profile_coefficients_.beta(r); + } + + double coeff_alpha; + if (!level_cache_.cacheDomainGeometry()) { + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_alpha = level_cache_.coeff_alpha()[i_r]; + } + else { + coeff_alpha = density_profile_coefficients_.alpha(r); + } + } + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + const double theta = grid_.theta(i_theta); + const double sin_theta = sin_theta_cache[i_theta]; + const double cos_theta = cos_theta_cache[i_theta]; + + /* Compute arr, att, art, detDF value at the current node */ + double arr, att, art, detDF; + if (level_cache_.cacheDomainGeometry()) { + const int index = grid_.index(i_r, i_theta); + arr = level_cache_.arr()[index]; + att = level_cache_.att()[index]; + art = level_cache_.art()[index]; + detDF = level_cache_.detDF()[index]; + } + else { + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + } + + // Apply Asc Ortho at the current node + NODE_APPLY_ASC_ORTHO_CIRCLE_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); + } +} + +void SmootherGive::applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, Vector& temp) +{ + const auto& sin_theta_cache = level_cache_.sin_theta(); + const auto& cos_theta_cache = level_cache_.cos_theta(); + + const double theta = grid_.theta(i_theta); + const double sin_theta = sin_theta_cache[i_theta]; + const double cos_theta = cos_theta_cache[i_theta]; + + /* !!! i_r = grid_.numberSmootherCircles()-1 !!! */ + for (int i_r = grid_.numberSmootherCircles() - 1; i_r < grid_.nr(); i_r++) { + const double r = grid_.radius(i_r); + + double coeff_beta; + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_beta = level_cache_.coeff_beta()[i_r]; + } + else { + coeff_beta = density_profile_coefficients_.beta(r); + } + + double coeff_alpha; + if (!level_cache_.cacheDomainGeometry()) { + if (level_cache_.cacheDensityProfileCoefficients()) { + coeff_alpha = level_cache_.coeff_alpha()[i_r]; + } + else { + coeff_alpha = density_profile_coefficients_.alpha(r); + } + } + + /* Compute arr, att, art, detDF value at the current node */ + double arr, att, art, detDF; + if (level_cache_.cacheDomainGeometry()) { + const int index = grid_.index(i_r, i_theta); + arr = level_cache_.arr()[index]; + att = level_cache_.att()[index]; + art = level_cache_.art()[index]; + detDF = level_cache_.detDF()[index]; + } + else { + compute_jacobian_elements(domain_geometry_, r, theta, sin_theta, cos_theta, coeff_alpha, arr, att, art, + detDF); + } + + // Apply Asc Ortho at the current node + NODE_APPLY_ASC_ORTHO_RADIAL_GIVE(i_r, i_theta, r, theta, sin_theta, cos_theta, grid_, DirBC_Interior_, + smoother_color, x, rhs, temp, arr, att, art, detDF, coeff_beta); + } +} + +void SmootherGive::solveCircleSection(const int i_r, Vector& x, Vector& temp, + Vector& solver_storage_1, Vector& solver_storage_2) +{ + const int start = grid_.index(i_r, 0); + const int end = start + grid_.ntheta(); + if (i_r == 0) { +#ifdef GMGPOLAR_USE_MUMPS + inner_boundary_mumps_solver_.job = JOB_COMPUTE_SOLUTION; + inner_boundary_mumps_solver_.nrhs = 1; // single rhs vector + inner_boundary_mumps_solver_.nz_rhs = grid_.ntheta(); // non-zeros in rhs + inner_boundary_mumps_solver_.rhs = temp.begin() + start; + inner_boundary_mumps_solver_.lrhs = grid_.ntheta(); // leading dimension of rhs + dmumps_c(&inner_boundary_mumps_solver_); + if (inner_boundary_mumps_solver_.info[0] != 0) { + std::cerr << "Error solving the system: " << inner_boundary_mumps_solver_.info[0] << std::endl; + } +#else + inner_boundary_lu_solver_.solveInPlace(temp.begin() + start); +#endif + } + else { + circle_tridiagonal_solver_[i_r].solveInPlace(temp.begin() + start, solver_storage_1.begin(), + solver_storage_2.begin()); + } + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +void SmootherGive::solveRadialSection(const int i_theta, Vector& x, Vector& temp, + Vector& solver_storage) +{ + const int start = grid_.index(grid_.numberSmootherCircles(), i_theta); + const int end = start + grid_.lengthSmootherRadial(); + + radial_tridiagonal_solver_[i_theta].solveInPlace(temp.begin() + start, solver_storage.begin()); + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +/* ------------------ */ +/* Sequential Version */ +/* ------------------ */ + +void SmootherGive::smoothingSequential(Vector& x, const Vector& rhs, Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + temp = rhs; + + /* Single-threaded execution */ + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + + /* ---------------------------- */ + /* ------ CIRCLE SECTION ------ */ + + /* The outer most circle next to the radial section is defined to be black. */ + /* Priority: Black -> White. */ + for (int i_r = 0; i_r < grid_.numberSmootherCircles() + 1; i_r++) { + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + const int start_black_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 1 : 0; + for (int i_r = start_black_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + const int start_white_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 0 : 1; + for (int i_r = start_white_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + /* ---------------------------- */ + /* ------ RADIAL SECTION ------ */ + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta += 2) { + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + for (int i_theta = 1; i_theta < grid_.ntheta(); i_theta += 2) { + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } +} + +/* ------------------------------------ */ +/* Parallelization Version 1: For Loops */ +/* ------------------------------------ */ +// clang-format off +void SmootherGive::smoothingForLoop(Vector& x, const Vector& rhs, Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + omp_set_num_threads(num_omp_threads_); + + if (omp_get_max_threads() == 1) { + smoothingSequential(x, rhs, temp); + } + else { + temp = rhs; + + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int num_radial_tasks = grid_.ntheta(); + + #pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + + /* ---------------------------- */ + /* ------ CIRCLE SECTION ------ */ + /* ---------------------------- */ + + /* ---------------------------- */ + /* Asc ortho Black Circle Tasks */ + + /* Inside Black Section */ + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + + /* Outside Black Section (Part 1)*/ + #pragma omp for + for (int circle_task = -1; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + + /* Outside Black Section (Part 2)*/ + #pragma omp for + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + + /* Black Circle Smoother */ + #pragma omp for + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* Inside White Section */ + #pragma omp for nowait + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* Inside Black Section */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* Outside White Section (Part 1)*/ + #pragma omp for nowait + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* Outside Black Section (Part 1) */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* Outside White Section (Part 2)*/ + #pragma omp for nowait + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* Outside Black Section (Part 2) */ + #pragma omp for + for (int radial_task = 3; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + + /* White Circle Smoother */ + #pragma omp for nowait + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + /* Black Radial Smoother */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + + /* Inside White Section */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + /* Outside White Section (Part 1) */ + #pragma omp for + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + /* Outside White Section (Part 2) */ + #pragma omp for + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + + /* White Radial Smoother */ + #pragma omp for + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + } +} +// clang-format on diff --git a/src/Smoother/SmootherGive/task_parallelization.cpp b/src/Smoother/SmootherGive/task_parallelization.cpp new file mode 100644 index 00000000..0fdbf3fd --- /dev/null +++ b/src/Smoother/SmootherGive/task_parallelization.cpp @@ -0,0 +1,483 @@ +#include "../../../include/Smoother/SmootherGive/smootherGive.h" + +/* ------------------------------------ */ +/* Parallelization Version 2: Task Loop */ +/* ------------------------------------ */ + +void SmootherGive::smoothingTaskLoop(Vector& x, const Vector& rhs, Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + omp_set_num_threads(num_omp_threads_); + + if (omp_get_max_threads() == 1) { + smoothingSequential(x, rhs, temp); + } + else { + temp = rhs; + + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int num_radial_tasks = grid_.ntheta(); + + /* Idea: Scedule first_black_circle_smoother as fast as possible to start the radial section early. */ + int first_circle_black_Asc0, first_circle_black_Asc1, first_circle_black_Asc2; + int first_black_circle_smoother; + + int circle_black_Asc0, circle_black_Asc1, circle_black_Asc2; + int black_circle_smoother; + int circle_white_Asc0, circle_white_Asc1, circle_white_Asc2; + int white_circle_smoother; + + int radial_black_Asc0, radial_black_Asc1, radial_black_Asc2; + int black_radial_smoother; + int radial_white_Asc0, radial_white_Asc1, radial_white_Asc2; + int white_radial_smoother; + +#pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + +#pragma omp single + { + /* ---------------------------------- */ + /* ------ CIRCLE BLACK SECTION ------ */ + /* ---------------------------------- */ + + /* --------------- */ + /* First few lines */ + +#pragma omp task depend(out : first_circle_black_Asc0) + { +#pragma omp taskloop + for (int circle_task = 0; circle_task < std::min(6, num_circle_tasks); circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : first_circle_black_Asc0) depend(out : first_circle_black_Asc1) + { +#pragma omp taskloop + for (int circle_task = -1; circle_task < std::min(7, num_circle_tasks); circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : first_circle_black_Asc1) depend(out : first_circle_black_Asc2) + { +#pragma omp taskloop + for (int circle_task = 1; circle_task < std::min(5, num_circle_tasks); circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : first_circle_black_Asc2) depend(out : first_black_circle_smoother) + { +#pragma omp taskloop + for (int circle_task = 0; circle_task < std::min(2, num_circle_tasks); circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* -------------- */ + /* Leftover lines */ + +#pragma omp task depend(out : circle_black_Asc0) + { +#pragma omp taskloop + for (int circle_task = 6; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +// We don't need depend(in: first_circle_black_Asc0) since there is enough separation. +#pragma omp task depend(in : circle_black_Asc0) depend(out : circle_black_Asc1) + { +#pragma omp taskloop + for (int circle_task = 7; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_black_Asc1, first_circle_black_Asc1) depend(out : circle_black_Asc2) + { +#pragma omp taskloop + for (int circle_task = 5; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_black_Asc2, first_circle_black_Asc2) depend(out : black_circle_smoother) + { +#pragma omp taskloop + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------------- */ + /* ------ CIRCLE WHITE SECTION ------ */ + /* ---------------------------------- */ + +#pragma omp task depend(in : black_circle_smoother, first_black_circle_smoother) depend(out : circle_white_Asc0) + { +#pragma omp taskloop + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_white_Asc0) depend(out : circle_white_Asc1) + { +#pragma omp taskloop + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_white_Asc1) depend(out : circle_white_Asc2) + { +#pragma omp taskloop + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 4) { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : circle_white_Asc2) + { +#pragma omp taskloop + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------------- */ + /* ------ RADIAL BLACK SECTION ------ */ + /* ---------------------------------- */ + +#pragma omp task depend(in : first_black_circle_smoother) depend(out : radial_black_Asc0) + { +#pragma omp taskloop + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_black_Asc0) depend(out : radial_black_Asc1) + { +#pragma omp taskloop + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_black_Asc1) depend(out : radial_black_Asc2) + { +#pragma omp taskloop + for (int radial_task = 3; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_black_Asc2) depend(out : black_radial_smoother) + { +#pragma omp taskloop + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + + /* ---------------------------------- */ + /* ------ RADIAL White SECTION ------ */ + /* ---------------------------------- */ + +#pragma omp task depend(in : black_radial_smoother) depend(out : radial_white_Asc0) + { +#pragma omp taskloop + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_white_Asc0) depend(out : radial_white_Asc1) + { +#pragma omp taskloop + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_white_Asc1) depend(out : radial_white_Asc2) + { +#pragma omp taskloop + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 4) { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + +#pragma omp task depend(in : radial_white_Asc2) + { +#pragma omp taskloop + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + } + } + } +} + +/* -------------------------------------------- */ +/* Parallelization Version 3: Task Dependencies */ +/* -------------------------------------------- */ + +void SmootherGive::smoothingTaskDependencies(Vector& x, const Vector& rhs, Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + omp_set_num_threads(num_omp_threads_); + + if (omp_get_max_threads() == 1) { + smoothingSequential(x, rhs, temp); + } + else { + temp = rhs; + + /* Multi-threaded execution */ + const int num_circle_tasks = grid_.numberSmootherCircles(); + const int num_radial_tasks = grid_.ntheta(); + + const int additional_radial_tasks = num_radial_tasks % 3; + + assert(num_circle_tasks >= 2); + assert(num_radial_tasks >= 3 && num_radial_tasks % 2 == 0); + + /* Make sure to deallocate at the end */ + const int shift = 3; // Additional space to ensure safe access + int* asc_ortho_circle_dep = new int[num_circle_tasks + 2 * shift]; // -1 is an additional asc_artho task! + int* smoother_circle_dep = new int[num_circle_tasks + 2 * shift]; + + int* asc_ortho_radial_dep = new int[num_radial_tasks]; + int* smoother_radial_dep = new int[num_radial_tasks]; + +#pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + +#pragma omp single + { + /* ---------------------------- */ + /* ------ CIRCLE SECTION ------ */ + + /* ---------------------------- */ + /* Asc ortho Black Circle Tasks */ + /* ---------------------------- */ + + /* Inside Black Section */ + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 1)*/ + for (int circle_task = -1; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 2)*/ + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 2 + shift], asc_ortho_circle_dep[circle_task + 2 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + } + } + + /* Black Circle Smoother */ + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : smoother_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* ---------------------------- */ + + /* Inside White Section */ + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : smoother_circle_dep[circle_task - 1 + shift], smoother_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 1)*/ + for (int circle_task = 0; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 2)*/ + for (int circle_task = 2; circle_task < num_circle_tasks; circle_task += 4) { +#pragma omp task depend(out : asc_ortho_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 2 + shift], asc_ortho_circle_dep[circle_task + 2 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + } + } + + /* White Circle Smoother */ + for (int circle_task = 1; circle_task < num_circle_tasks; circle_task += 2) { +#pragma omp task depend(out : smoother_circle_dep[circle_task + shift]) \ + depend(in : asc_ortho_circle_dep[circle_task - 1 + shift], asc_ortho_circle_dep[circle_task + 1 + shift]) + { + int i_r = num_circle_tasks - circle_task - 1; + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + } + + /* ---------------------------- */ + /* ------ RADIAL SECTION ------ */ + + /* ---------------------------- */ + /* Asc ortho Black Radial Tasks */ + /* ---------------------------- */ + + /* Inside Black Section */ + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) depend(in : smoother_circle_dep[0 + shift]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 1) */ + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + /* Outside Black Section (Part 2) */ + for (int radial_task = 3; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 2 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 2 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + } + } + + /* Black Radial Smoother */ + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : smoother_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 0 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + + /* ---------------------------- */ + /* Asc ortho White Circle Tasks */ + /* ---------------------------- */ + + /* Inside White Section */ + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : smoother_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + smoother_radial_dep[(radial_task + 0 + num_radial_tasks) % num_radial_tasks], \ + smoother_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 1) */ + for (int radial_task = 0; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + /* Outside White Section (Part 2) */ + for (int radial_task = 2; radial_task < num_radial_tasks; radial_task += 4) { +#pragma omp task depend(out : asc_ortho_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 2 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 2 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + } + } + + /* White Radial Smoother */ + for (int radial_task = 1; radial_task < num_radial_tasks; radial_task += 2) { +#pragma omp task depend(out : smoother_radial_dep[radial_task]) \ + depend(in : asc_ortho_radial_dep[(radial_task - 1 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 0 + num_radial_tasks) % num_radial_tasks], \ + asc_ortho_radial_dep[(radial_task + 1 + num_radial_tasks) % num_radial_tasks]) + { + int i_theta = radial_task; + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } + } + } + } + delete[] asc_ortho_circle_dep; + delete[] asc_ortho_radial_dep; + delete[] smoother_circle_dep; + delete[] smoother_radial_dep; + } +} diff --git a/src/Smoother/SmootherTake/buildMatrix.cpp b/src/Smoother/SmootherTake/buildMatrix.cpp new file mode 100644 index 00000000..14b7da22 --- /dev/null +++ b/src/Smoother/SmootherTake/buildMatrix.cpp @@ -0,0 +1,488 @@ +#include "../../../include/Smoother/SmootherTake/smootherTake.h" + +/* Tridiagonal matrices */ +#define UPDATE_MATRIX_ELEMENT(matrix, row, column, value) \ + do { \ + if (row == column) \ + matrix.main_diagonal(row) = value; \ + else if (row == column - 1) \ + matrix.sub_diagonal(row) = value; \ + else if (row == 0 && column == matrix.columns() - 1) \ + matrix.cyclic_corner_element() = value; \ + } while (0) + +/* Inner Boundary COO/CSR matrix */ +#ifdef GMGPOLAR_USE_MUMPS + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_index(ptr + offset) = row; \ + matrix.col_index(ptr + offset) = col; \ + matrix.value(ptr + offset) = val; \ + } while (0) +#else + #define COO_CSR_UPDATE(matrix, ptr, offset, row, col, val) \ + do { \ + matrix.row_nz_index(row, offset) = col; \ + matrix.row_nz_entry(row, offset) = val; \ + } while (0) +#endif + +#define NODE_BUILD_SMOOTHER_TAKE(i_r, i_theta, grid, DirBC_Interior, inner_boundary_circle_matrix, \ + circle_tridiagonal_solver, radial_tridiagonal_solver) \ + do { \ + assert(i_r >= 0 && i_r < grid.nr()); \ + assert(i_theta >= 0 && i_theta < grid.ntheta()); \ + \ + const int numberSmootherCircles = grid.numberSmootherCircles(); \ + const int lengthSmootherRadial = grid.lengthSmootherRadial(); \ + \ + assert(numberSmootherCircles >= 2); \ + assert(lengthSmootherRadial >= 3); \ + \ + int row, column; \ + double value; \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Circle Section */ \ + /* ------------------------------------------ */ \ + if (i_r > 0 && i_r < numberSmootherCircles) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + auto& matrix = circle_tridiagonal_solver[i_r]; \ + const int center_index = i_theta; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Bottom */ \ + row = center_index; \ + column = bottom_index; \ + value = -coeff3 * (att[center] + att[bottom]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Top */ \ + row = center_index; \ + column = top_index; \ + value = -coeff4 * (att[center] + att[top]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + } \ + /* ------------------------------------------ */ \ + /* Node in the interior of the Radial Section */ \ + /* ------------------------------------------ */ \ + else if (i_r > numberSmootherCircles && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta]; \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Left */ \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * (arr[center] + arr[left]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Right */ \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * (arr[center] + arr[right]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + } \ + /* ------------------------------------------ */ \ + /* Circle Section: Node in the inner boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == 0) { \ + /* ------------------------------------------------ */ \ + /* Case 1: Dirichlet boundary on the inner boundary */ \ + /* ------------------------------------------------ */ \ + int ptr, offset; \ + int row, col; \ + double val; \ + if (DirBC_Interior) { \ + auto& matrix = inner_boundary_circle_matrix; \ + const int center_index = i_theta; \ + const int center_nz_index = getCircleAscIndex(i_r, i_theta); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = 1.0; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + const double h1 = 2.0 * grid.radius(0); \ + const double h2 = grid.radialSpacing(i_r); \ + const double k1 = grid.angularSpacing(i_theta - 1); \ + const double k2 = grid.angularSpacing(i_theta); \ + \ + const double coeff1 = 0.5 * (k1 + k2) / h1; \ + const double coeff2 = 0.5 * (k1 + k2) / h2; \ + const double coeff3 = 0.5 * (h1 + h2) / k1; \ + const double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + const int i_theta_AcrossOrigin = grid.wrapThetaIndex(i_theta + grid.ntheta() / 2); \ + \ + const int left = grid.index(i_r, i_theta_AcrossOrigin); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + auto& matrix = inner_boundary_circle_matrix; \ + \ + const int center_index = i_theta; \ + const int left_index = i_theta_AcrossOrigin; \ + const int bottom_index = i_theta_M1; \ + const int top_index = i_theta_P1; \ + \ + const int center_nz_index = getCircleAscIndex(i_r, i_theta); \ + \ + const double center_value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + const double left_value = -coeff1 * (arr[center] + arr[left]); \ + const double bottom_value = -coeff3 * (att[center] + att[bottom]); \ + const double top_value = -coeff4 * (att[center] + att[top]); \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + ptr = center_nz_index; \ + \ + const Stencil& CenterStencil = getStencil(i_r); \ + \ + offset = CenterStencil[StencilPosition::Center]; \ + col = center_index; \ + val = center_value; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Left]; \ + col = left_index; \ + val = left_value; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Bottom]; \ + col = bottom_index; \ + val = bottom_value; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + \ + offset = CenterStencil[StencilPosition::Top]; \ + col = top_index; \ + val = top_value; \ + COO_CSR_UPDATE(matrix, ptr, offset, row, col, val); \ + } \ + } \ + /* --------------------------------------------- */ \ + /* Radial Section: Node next to circular section */ \ + /* --------------------------------------------- */ \ + else if (i_r == numberSmootherCircles) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta]; \ + const int center_index = i_r - numberSmootherCircles; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Right */ \ + row = center_index; \ + column = right_index; \ + value = -coeff2 * (arr[center] + arr[right]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + } \ + /* ------------------------------------------- */ \ + /* Radial Section: Node next to outer boundary */ \ + /* ------------------------------------------- */ \ + else if (i_r == grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int left = grid.index(i_r - 1, i_theta); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int right = grid.index(i_r + 1, i_theta); \ + \ + auto& matrix = radial_tridiagonal_solver[i_theta]; \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + const int right_index = i_r - numberSmootherCircles + 1; \ + \ + /* Center: (Left, Right, Bottom, Top) */ \ + row = center_index; \ + column = center_index; \ + value = 0.25 * (h1 + h2) * (k1 + k2) * coeff_beta[i_r] * fabs(detDF[center]) + \ + coeff1 * (arr[center] + arr[left]) + coeff2 * (arr[center] + arr[right]) + \ + coeff3 * (att[center] + att[bottom]) + coeff4 * (att[center] + att[top]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Left */ \ + row = center_index; \ + column = left_index; \ + value = -coeff1 * (arr[center] + arr[left]); \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Right: NOT INCLUDED! */ \ + row = center_index; \ + column = right_index; \ + value = 0.0; \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + } \ + /* ------------------------------------------ */ \ + /* Radial Section: Node on the outer boundary */ \ + /* ------------------------------------------ */ \ + else if (i_r == grid.nr() - 1) { \ + auto& matrix = radial_tridiagonal_solver[i_theta]; \ + const int center_index = i_r - numberSmootherCircles; \ + const int left_index = i_r - numberSmootherCircles - 1; \ + \ + /* Fill matrix row of (i,j) */ \ + row = center_index; \ + column = center_index; \ + value = 1.0; \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + \ + /* Left: NOT INCLUDED */ \ + row = center_index; \ + column = left_index; \ + value = 0.0; \ + UPDATE_MATRIX_ELEMENT(matrix, row, column, value); \ + } \ + } while (0) + +void SmootherTake::buildAscCircleSection(const int i_r) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + // Build Asc at the current node + NODE_BUILD_SMOOTHER_TAKE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_tridiagonal_solver_, radial_tridiagonal_solver_); + } +} + +void SmootherTake::buildAscRadialSection(const int i_theta) +{ + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + // Build Asc at the current node + NODE_BUILD_SMOOTHER_TAKE(i_r, i_theta, grid_, DirBC_Interior_, inner_boundary_circle_matrix_, + circle_tridiagonal_solver_, radial_tridiagonal_solver_); + } +} + +// clang-format off +void SmootherTake::buildAscMatrices() +{ + omp_set_num_threads(num_omp_threads_); + + /* -------------------------------------- */ + /* Part 1: Allocate Asc Smoother matrices */ + /* -------------------------------------- */ + + const int number_smoother_circles = grid_.numberSmootherCircles(); + const int length_smoother_radial = grid_.lengthSmootherRadial(); + + const int num_circle_nodes = grid_.ntheta(); + circle_tridiagonal_solver_.resize(number_smoother_circles); + + const int num_radial_nodes = length_smoother_radial; + radial_tridiagonal_solver_.resize(grid_.ntheta()); + + // Remark: circle_tridiagonal_solver_[0] is unitialized. + // Please use inner_boundary_circle_matrix_ instead! + #pragma omp parallel if (grid_.numberOfNodes() > 10'000) + { + // ---------------- // + // Circular Section // + #pragma omp for nowait + for (int circle_Asc_index = 0; circle_Asc_index < number_smoother_circles; circle_Asc_index++) { + + /* Inner boundary circle */ + if (circle_Asc_index == 0) { + #ifdef GMGPOLAR_USE_MUMPS + // Although the matrix is symmetric, we need to store all its entries, so we disable the symmetry. + const int nnz = getNonZeroCountCircleAsc(circle_Asc_index); + inner_boundary_circle_matrix_ = SparseMatrixCOO(num_circle_nodes, num_circle_nodes, nnz); + inner_boundary_circle_matrix_.is_symmetric(false); + #else + std::function nnz_per_row = [&](int i_theta) { + return DirBC_Interior_? 1 : 4; + }; + inner_boundary_circle_matrix_ = SparseMatrixCSR(num_circle_nodes, num_circle_nodes, nnz_per_row); + #endif + } + + /* Interior Circle Section */ + else { + auto& solverMatrix = circle_tridiagonal_solver_[circle_Asc_index]; + solverMatrix = SymmetricTridiagonalSolver(num_circle_nodes); + solverMatrix.is_cyclic(true); + } + } + + // -------------- // + // Radial Section // + #pragma omp for nowait + for (int radial_Asc_index = 0; radial_Asc_index < grid_.ntheta(); radial_Asc_index++) { + auto& solverMatrix = radial_tridiagonal_solver_[radial_Asc_index]; + solverMatrix = SymmetricTridiagonalSolver(num_radial_nodes); + solverMatrix.is_cyclic(false); + } + } + + /* ---------------------------------- */ + /* Part 2: Fill Asc Smoother matrices */ + /* ---------------------------------- */ + + #pragma omp parallel + { + #pragma omp for nowait + for (int i_r = 0; i_r < grid_.numberSmootherCircles(); i_r++) { + buildAscCircleSection(i_r); + } + + #pragma omp for nowait + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + buildAscRadialSection(i_theta); + } + } + + #ifdef GMGPOLAR_USE_MUMPS + /* ------------------------------------------------------------------ */ + /* Part 3: Convert inner_boundary_circle_matrix to a symmetric matrix */ + /* ------------------------------------------------------------------ */ + + SparseMatrixCOO full_matrix = std::move(inner_boundary_circle_matrix_); + + const int nnz = full_matrix.non_zero_size(); + const int numRows = full_matrix.rows(); + const int numColumns = full_matrix.columns(); + const int symmetric_nnz = nnz - (nnz - numRows) / 2; + + inner_boundary_circle_matrix_ = SparseMatrixCOO(numRows, numColumns, symmetric_nnz); + inner_boundary_circle_matrix_.is_symmetric(true); + + int current_nz = 0; + for (int nz_index = 0; nz_index < full_matrix.non_zero_size(); nz_index++) { + int current_row = full_matrix.row_index(nz_index); + int current_col = full_matrix.col_index(nz_index); + if (current_row <= current_col) { + inner_boundary_circle_matrix_.row_index(current_nz) = current_row; + inner_boundary_circle_matrix_.col_index(current_nz) = current_col; + inner_boundary_circle_matrix_.value(current_nz) = std::move(full_matrix.value(nz_index)); + current_nz++; + } + } + #endif +} +// clang-format on \ No newline at end of file diff --git a/src/Smoother/SmootherTake/initializeMumps.cpp b/src/Smoother/SmootherTake/initializeMumps.cpp new file mode 100644 index 00000000..f7496ed0 --- /dev/null +++ b/src/Smoother/SmootherTake/initializeMumps.cpp @@ -0,0 +1,111 @@ +#include "../../../include/Smoother/SmootherTake/smootherTake.h" + +#ifdef GMGPOLAR_USE_MUMPS + +void SmootherTake::initializeMumpsSolver(DMUMPS_STRUC_C& mumps_solver, SparseMatrixCOO& solver_matrix) +{ + /* + * MUMPS (a parallel direct solver) uses 1-based indexing, + * whereas the input matrix follows 0-based indexing. + * Adjust row and column indices to match MUMPS' requirements. + */ + for (int i = 0; i < solver_matrix.non_zero_size(); i++) { + solver_matrix.row_index(i) += 1; + solver_matrix.col_index(i) += 1; + } + + mumps_solver.job = JOB_INIT; + mumps_solver.par = PAR_PARALLEL; + /* The matrix is positive definite for invertible mappings. */ + /* Therefore we use SYM_POSITIVE_DEFINITE instead of SYM_GENERAL_SYMMETRIC. */ + mumps_solver.sym = (solver_matrix.is_symmetric() ? SYM_POSITIVE_DEFINITE : SYM_UNSYMMETRIC); + mumps_solver.comm_fortran = USE_COMM_WORLD; + dmumps_c(&mumps_solver); + + mumps_solver.ICNTL(1) = 0; // Output stream for error messages. + mumps_solver.ICNTL(2) = 0; // Output stream for diagnostic printing and statistics local to each MPI process. + mumps_solver.ICNTL(3) = 0; // Output stream for global information, collected on the host + mumps_solver.ICNTL(4) = 0; // Level of printing for error, warning, and diagnostic messages. + mumps_solver.ICNTL(5) = 0; // Controls the matrix input format + mumps_solver.ICNTL(6) = 7; // Permutes the matrix to a zero-free diagonal and/or scale the matrix + mumps_solver.ICNTL(7) = + 5; // Computes a symmetric permutation (ordering) to determine the pivot order to be used for the factorization in case of sequential analysis + mumps_solver.ICNTL(8) = 77; // Describes the scaling strategy + mumps_solver.ICNTL(9) = 1; // Computes the solution using A or A^T + mumps_solver.ICNTL(10) = 0; // Applies the iterative refinement to the computed solution + mumps_solver.ICNTL(11) = 0; // Computes statistics related to an error analysis of the linear system solved + mumps_solver.ICNTL(12) = 0; // Defines an ordering strategy for symmetric matrices and is used + mumps_solver.ICNTL(13) = 0; // Controls the parallelism of the root node + mumps_solver.ICNTL(14) = // Controls the percentage increase in the estimated working space + (solver_matrix.is_symmetric() ? 5 : 20); + mumps_solver.ICNTL(15) = 0; // Exploits compression of the input matrix resulting from a block format + mumps_solver.ICNTL(16) = 0; // Controls the setting of the number of OpenMP threads + // ICNTL(17) Doesn't exist + mumps_solver.ICNTL(18) = 0; // Defines the strategy for the distributed input matrix + mumps_solver.ICNTL(19) = 0; // Computes the Schur complement matrix + mumps_solver.ICNTL(20) = 0; // Determines the format (dense, sparse, or distributed) of the right-hand sides + mumps_solver.ICNTL(21) = 0; // Determines the distribution (centralized or distributed) of the solution vectors. + mumps_solver.ICNTL(22) = 0; // Controls the in-core/out-of-core (OOC) factorization and solve. + mumps_solver.ICNTL(23) = 0; // Corresponds to the maximum size of the working memory in MegaBytes that MUMPS can + // allocate per working process + mumps_solver.ICNTL(24) = 0; // Controls the detection of “null pivot rows”. + mumps_solver.ICNTL(25) = + 0; // Allows the computation of a solution of a deficient matrix and also of a null space basis + mumps_solver.ICNTL(26) = 0; // Drives the solution phase if a Schur complement matrix has been computed + mumps_solver.ICNTL(27) = -32; // Controls the blocking size for multiple right-hand sides. + mumps_solver.ICNTL(28) = 0; // Determines whether a sequential or parallel computation of the ordering is performed + mumps_solver.ICNTL(29) = + 0; // Defines the parallel ordering tool (when ICNTL(28)=1) to be used to compute the fill-in reducing permutation. + mumps_solver.ICNTL(30) = 0; // Computes a user-specified set of entries in the inverse A^−1 of the original matrix + mumps_solver.ICNTL(31) = 0; // Indicates which factors may be discarded during the factorization. + mumps_solver.ICNTL(32) = 0; // Performs the forward elimination of the right-hand sides during the factorization + mumps_solver.ICNTL(33) = 0; // Computes the determinant of the input matrix. + mumps_solver.ICNTL(34) = 0; // Controls the conservation of the OOC files during JOB= –3 + mumps_solver.ICNTL(35) = 0; // Controls the activation of the BLR feature + mumps_solver.ICNTL(36) = 0; // Controls the choice of BLR factorization variant + mumps_solver.ICNTL(37) = 0; // Controls the BLR compression of the contribution blocks + mumps_solver.ICNTL(38) = 600; // Estimates compression rate of LU factors + mumps_solver.ICNTL(39) = 500; // Estimates compression rate of contribution blocks + // ICNTL(40-47) Don't exist + mumps_solver.ICNTL(48) = 1; // Multithreading with tree parallelism + mumps_solver.ICNTL(49) = 0; // Compact workarray id%S at the end of factorization phase + // ICNTL(50-55) Don't exist + mumps_solver.ICNTL(56) = + 0; // Detects pseudo-singularities during factorization and factorizes the root node with a rankrevealing method + // ICNTL(57) Doesn't exist + mumps_solver.ICNTL(58) = 2; // Defines options for symbolic factorization + // ICNTL(59-60) Don't exist + + mumps_solver.CNTL(1) = -1.0; // Relative threshold for numerical pivoting + mumps_solver.CNTL(2) = -1.0; // Stopping criterion for iterative refinement + mumps_solver.CNTL(3) = 0.0; // Determine null pivot rows + mumps_solver.CNTL(4) = -1.0; // Determines the threshold for static pivoting + mumps_solver.CNTL(5) = + 0.0; // Defines the fixation for null pivots and is effective only when null pivot row detection is active + // CNTL(6) Doesn't exist + mumps_solver.CNTL(7) = 0.0; // Defines the precision of the dropping parameter used during BLR compression + // CNTL(8-15) Don't exist + + mumps_solver.job = JOB_ANALYSIS_AND_FACTORIZATION; + assert(solver_matrix.rows() == solver_matrix.columns()); + mumps_solver.n = solver_matrix.rows(); + mumps_solver.nz = solver_matrix.non_zero_size(); + mumps_solver.irn = solver_matrix.row_indices_data(); + mumps_solver.jcn = solver_matrix.column_indices_data(); + mumps_solver.a = solver_matrix.values_data(); + dmumps_c(&mumps_solver); + + if (mumps_solver.sym == SYM_POSITIVE_DEFINITE && mumps_solver.INFOG(12) != 0) { + std::cout << "Warning: Smoother inner boundary matrix is not positive definite: Negative pivots in the " + "factorization phase." + << std::endl; + } +} + +void SmootherTake::finalizeMumpsSolver(DMUMPS_STRUC_C& mumps_solver) +{ + mumps_solver.job = JOB_END; + dmumps_c(&mumps_solver); +} + +#endif \ No newline at end of file diff --git a/src/Smoother/SmootherTake/matrixStencil.cpp b/src/Smoother/SmootherTake/matrixStencil.cpp new file mode 100644 index 00000000..d86be48e --- /dev/null +++ b/src/Smoother/SmootherTake/matrixStencil.cpp @@ -0,0 +1,117 @@ +#include "../../../include/Smoother/SmootherTake/smootherTake.h" + +const Stencil& SmootherTake::getStencil(int i_r) const +{ + assert(0 <= i_r && i_r < grid_.nr()); + + assert(grid_.numberSmootherCircles() >= 2); + assert(grid_.lengthSmootherRadial() >= 3); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + if (i_r < numberSmootherCircles) { + /* Circle Section */ + if (i_r > 0 && i_r < numberSmootherCircles) { + return circle_stencil_interior_; + } + else if (i_r == 0) { + return DirBC_Interior_ ? stencil_DB_ : circle_stencil_across_origin_; + } + } + else { + /* Radial Section */ + if (i_r > numberSmootherCircles && i_r < grid_.nr() - 2) { + return radial_stencil_interior_; + } + else if (i_r == numberSmootherCircles) { + return radial_stencil_next_circular_smoothing_; + } + else if (i_r == grid_.nr() - 1) { + return stencil_DB_; + } + else if (i_r == grid_.nr() - 2) { + return radial_stencil_next_outer_DB_; + } + } + throw std::out_of_range("Invalid index for stencil"); +} + +int SmootherTake::getNonZeroCountCircleAsc(const int i_r) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 4; + const int size_stencil_interior = 3; + + if (i_r > 0) { + return size_stencil_interior * grid_.ntheta(); + } + else if (i_r == 0) { + return size_stencil_inner_boundary * grid_.ntheta(); + } + throw std::out_of_range("Invalid index for nnz_circle_Asc"); +} + +int SmootherTake::getCircleAscIndex(const int i_r, const int i_theta) const +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + const int size_stencil_inner_boundary = DirBC_Interior_ ? 1 : 4; + const int size_stencil_interior = 3; + + if (i_r > 0) { + return size_stencil_interior * i_theta; + } + else { + return size_stencil_inner_boundary * i_theta; + } +} + +int SmootherTake::getNonZeroCountRadialAsc(const int i_theta) const +{ + assert(i_theta >= 0 && i_theta < grid_.ntheta()); + + const int size_stencil_next_circluar_smoothing = 2; + const int size_stencil_interior = 3; + const int size_stencil_next_outer_boundary = 2; + const int size_stencil_outer_boundary = 1; + + assert(grid_.lengthSmootherRadial() >= 3); + + return size_stencil_next_circluar_smoothing + (grid_.lengthSmootherRadial() - 3) * size_stencil_interior + + size_stencil_next_outer_boundary + size_stencil_outer_boundary; +} + +int SmootherTake::getRadialAscIndex(const int i_r, const int i_theta) const +{ + assert(i_theta >= 0 && i_theta < grid_.ntheta()); + + const int size_stencil_next_circluar_smoothing = 2; + const int size_stencil_interior = 3; + const int size_stencil_next_outer_boundary = 2; + const int size_stencil_outer_boundary = 1; + + assert(grid_.lengthSmootherRadial() >= 3); + assert(grid_.numberSmootherCircles() >= 2); + + const int numberSmootherCircles = grid_.numberSmootherCircles(); + + if (i_r > numberSmootherCircles && i_r < grid_.nr() - 2) { + return size_stencil_next_circluar_smoothing + (i_r - numberSmootherCircles - 1) * size_stencil_interior; + } + else if (i_r == numberSmootherCircles) { + return 0; + } + else if (i_r == grid_.nr() - 2) { + return size_stencil_next_circluar_smoothing + (grid_.lengthSmootherRadial() - 3) * size_stencil_interior; + } + else if (i_r == grid_.nr() - 1) { + return size_stencil_next_circluar_smoothing + (grid_.lengthSmootherRadial() - 3) * size_stencil_interior + + size_stencil_next_outer_boundary; + } + throw std::out_of_range("Invalid index for stencil"); +} diff --git a/src/Smoother/SmootherTake/smootherSolver.cpp b/src/Smoother/SmootherTake/smootherSolver.cpp new file mode 100644 index 00000000..f42748bb --- /dev/null +++ b/src/Smoother/SmootherTake/smootherSolver.cpp @@ -0,0 +1,335 @@ +#include "../../../include/Smoother/SmootherTake/smootherTake.h" + +#define NODE_APPLY_ASC_ORTHO_CIRCLE_TAKE(i_r, i_theta, grid, DirBC_Interior, smoother_color, x, rhs, temp, arr, att, \ + art, detDF, coeff_beta) \ + do { \ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); \ + \ + if (i_r > 0 && i_r < grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + temp[center] = rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else if (i_r == 0) { \ + if (DirBC_Interior) { \ + const int center = grid.index(i_r, i_theta); \ + temp[center] = rhs[center]; \ + } \ + else { \ + /* ------------------------------------------------------------- */ \ + /* Case 2: Across origin discretization on the interior boundary */ \ + /* ------------------------------------------------------------- */ \ + /* h1 gets replaced with 2 * R0. */ \ + /* (i_r-1,i_theta) gets replaced with (i_r, i_theta + (grid.ntheta()/2)). */ \ + /* Some more adjustments from the changing the 9-point stencil to the artifical 7-point stencil. */ \ + double h1 = 2.0 * grid.radius(0); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid_.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid_.wrapThetaIndex(i_theta + 1); \ + const int i_theta_Across = grid_.wrapThetaIndex(i_theta + grid_.ntheta() / 2); \ + \ + const int left = grid_.index(i_r, i_theta_Across); \ + const int bottom = grid_.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid_.index(i_r, i_theta_P1); \ + const int bottom_right = grid_.index(i_r + 1, i_theta_M1); \ + const int right = grid_.index(i_r + 1, i_theta); \ + const int top_right = grid_.index(i_r + 1, i_theta_P1); \ + \ + temp[center] = \ + rhs[center] - \ + (-coeff2 * (arr[center] + arr[right]) * x[right] /* Right */ \ + \ + /* - 0.25 * (art[left] + art[bottom]) * x[bottom_left] // Bottom Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + \ + /* + 0.25 * (art[left] + art[top]) * x[top_left] // Top Left: REMOVED DUE TO ARTIFICAL 7 POINT STENCIL */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + } \ + } while (0) + +#define NODE_APPLY_ASC_ORTHO_RADIAL_TAKE(i_r, i_theta, grid, DirBC_Interior, smoother_color, x, rhs, temp, arr, att, \ + art, detDF, coeff_beta) \ + do { \ + assert(i_r >= grid.numberSmootherCircles() && i_r < grid.nr()); \ + /* -------------------- */ \ + /* Node in the interior */ \ + /* -------------------- */ \ + if (i_r > grid.numberSmootherCircles() && i_r < grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + temp[center] = rhs[center] - (-coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else if (i_r == grid.numberSmootherCircles()) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + \ + temp[center] = rhs[center] - (-coeff1 * (arr[center] + arr[left]) * x[left] /* Left */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else if (i_r == grid.nr() - 2) { \ + double h1 = grid.radialSpacing(i_r - 1); \ + double h2 = grid.radialSpacing(i_r); \ + double k1 = grid.angularSpacing(i_theta - 1); \ + double k2 = grid.angularSpacing(i_theta); \ + \ + double coeff1 = 0.5 * (k1 + k2) / h1; \ + double coeff2 = 0.5 * (k1 + k2) / h2; \ + double coeff3 = 0.5 * (h1 + h2) / k1; \ + double coeff4 = 0.5 * (h1 + h2) / k2; \ + \ + const int i_theta_M1 = grid.wrapThetaIndex(i_theta - 1); \ + const int i_theta_P1 = grid.wrapThetaIndex(i_theta + 1); \ + \ + const int bottom_left = grid.index(i_r - 1, i_theta_M1); \ + const int left = grid.index(i_r - 1, i_theta); \ + const int top_left = grid.index(i_r - 1, i_theta_P1); \ + const int bottom = grid.index(i_r, i_theta_M1); \ + const int center = grid.index(i_r, i_theta); \ + const int top = grid.index(i_r, i_theta_P1); \ + const int bottom_right = grid.index(i_r + 1, i_theta_M1); \ + const int right = grid.index(i_r + 1, i_theta); \ + const int top_right = grid.index(i_r + 1, i_theta_P1); \ + /* "Right" is part of the radial Asc smoother matrices, */ \ + /* but is shifted over to the rhs to make the radial Asc smoother matrices symmetric. */ \ + /* Note that the circle Asc smoother matrices are symmetric by default. */ \ + /* Note that rhs[right] contains the correct boundary value of u_D. */ \ + temp[center] = rhs[center] - (-coeff2 * (arr[center] + arr[right]) * rhs[right] /* Right */ \ + - coeff3 * (att[center] + att[bottom]) * x[bottom] /* Bottom */ \ + - coeff4 * (att[center] + att[top]) * x[top] /* Top */ \ + \ + - 0.25 * (art[left] + art[bottom]) * x[bottom_left] /* Bottom Left */ \ + + 0.25 * (art[right] + art[bottom]) * x[bottom_right] /* Bottom Right */ \ + + 0.25 * (art[left] + art[top]) * x[top_left] /* Top Left */ \ + - 0.25 * (art[right] + art[top]) * x[top_right] /* Top Right */ \ + ); \ + } \ + else if (i_r == grid.nr() - 1) { \ + const int center = grid.index(i_r, i_theta); \ + temp[center] = rhs[center]; \ + } \ + } while (0) + +void SmootherTake::applyAscOrthoCircleSection(const int i_r, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, Vector& temp) +{ + assert(i_r >= 0 && i_r < grid_.numberSmootherCircles()); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta++) { + NODE_APPLY_ASC_ORTHO_CIRCLE_TAKE(i_r, i_theta, grid_, DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, + art, detDF, coeff_beta); + } +} + +void SmootherTake::applyAscOrthoRadialSection(const int i_theta, const SmootherColor smoother_color, + const Vector& x, const Vector& rhs, Vector& temp) +{ + assert(i_theta >= 0 && i_theta < grid_.ntheta()); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + const auto& arr = level_cache_.arr(); + const auto& att = level_cache_.att(); + const auto& art = level_cache_.art(); + const auto& detDF = level_cache_.detDF(); + const auto& coeff_beta = level_cache_.coeff_beta(); + + for (int i_r = grid_.numberSmootherCircles(); i_r < grid_.nr(); i_r++) { + NODE_APPLY_ASC_ORTHO_RADIAL_TAKE(i_r, i_theta, grid_, DirBC_Interior_, smoother_color, x, rhs, temp, arr, att, + art, detDF, coeff_beta); + } +} + +void SmootherTake::solveCircleSection(const int i_r, Vector& x, Vector& temp, + Vector& solver_storage_1, Vector& solver_storage_2) +{ + const int start = grid_.index(i_r, 0); + const int end = start + grid_.ntheta(); + if (i_r == 0) { +#ifdef GMGPOLAR_USE_MUMPS + inner_boundary_mumps_solver_.job = JOB_COMPUTE_SOLUTION; + inner_boundary_mumps_solver_.nrhs = 1; // single rhs vector + inner_boundary_mumps_solver_.nz_rhs = grid_.ntheta(); // non-zeros in rhs + inner_boundary_mumps_solver_.rhs = temp.begin() + start; + inner_boundary_mumps_solver_.lrhs = grid_.ntheta(); // leading dimension of rhs + dmumps_c(&inner_boundary_mumps_solver_); + if (inner_boundary_mumps_solver_.info[0] != 0) { + std::cerr << "Error solving the system: " << inner_boundary_mumps_solver_.info[0] << std::endl; + } +#else + inner_boundary_lu_solver_.solveInPlace(temp.begin() + start); +#endif + } + else { + circle_tridiagonal_solver_[i_r].solveInPlace(temp.begin() + start, solver_storage_1.begin(), + solver_storage_2.begin()); + } + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +void SmootherTake::solveRadialSection(const int i_theta, Vector& x, Vector& temp, + Vector& solver_storage) +{ + const int start = grid_.index(grid_.numberSmootherCircles(), i_theta); + const int end = start + grid_.lengthSmootherRadial(); + + radial_tridiagonal_solver_[i_theta].solveInPlace(temp.begin() + start, solver_storage.begin()); + // Move updated values to x + std::move(temp.begin() + start, temp.begin() + end, x.begin() + start); +} + +// clang-format off + +// In temp we store the vector 'rhs - A_sc^ortho u_sc^ortho' and then we solve the system +// Asc * u_sc = temp in place and move the updated values into 'x'. +void SmootherTake::smoothing(Vector& x, const Vector& rhs, Vector& temp) +{ + assert(x.size() == rhs.size()); + assert(temp.size() == rhs.size()); + + assert(level_cache_.cacheDensityProfileCoefficients()); + assert(level_cache_.cacheDomainGeometry()); + + #pragma omp parallel + { + Vector circle_solver_storage_1(grid_.ntheta()); + Vector circle_solver_storage_2(grid_.ntheta()); + Vector radial_solver_storage(grid_.lengthSmootherRadial()); + + /* The outer most circle next to the radial section is defined to be black. */ + /* Priority: Black -> White. */ + const int start_black_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 1 : 0; + const int start_white_circles = (grid_.numberSmootherCircles() % 2 == 0) ? 0 : 1; + + /* Black Circle Section */ + #pragma omp for + for (int i_r = start_black_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + applyAscOrthoCircleSection(i_r, SmootherColor::Black, x, rhs, temp); + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } /* Implicit barrier */ + + /* White Circle Section */ + #pragma omp for nowait + for (int i_r = start_white_circles; i_r < grid_.numberSmootherCircles(); i_r += 2) { + applyAscOrthoCircleSection(i_r, SmootherColor::White, x, rhs, temp); + solveCircleSection(i_r, x, temp, circle_solver_storage_1, circle_solver_storage_2); + } + /* Black Radial Section */ + #pragma omp for + for (int i_theta = 0; i_theta < grid_.ntheta(); i_theta += 2) { + applyAscOrthoRadialSection(i_theta, SmootherColor::Black, x, rhs, temp); + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } /* Implicit barrier */ + + /* White Radial Section*/ + #pragma omp for + for (int i_theta = 1; i_theta < grid_.ntheta(); i_theta += 2) { + applyAscOrthoRadialSection(i_theta, SmootherColor::White, x, rhs, temp); + solveRadialSection(i_theta, x, temp, radial_solver_storage); + } /* Implicit barrier */ + } +} +// clang-format on diff --git a/src/Smoother/SmootherTake/smootherTake.cpp b/src/Smoother/SmootherTake/smootherTake.cpp new file mode 100644 index 00000000..78f99d03 --- /dev/null +++ b/src/Smoother/SmootherTake/smootherTake.cpp @@ -0,0 +1,21 @@ +#include "../../../include/Smoother/SmootherTake/smootherTake.h" + +SmootherTake::SmootherTake(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : Smoother(grid, level_cache, domain_geometry, density_profile_coefficients, DirBC_Interior, num_omp_threads) +{ + buildAscMatrices(); +#ifdef GMGPOLAR_USE_MUMPS + initializeMumpsSolver(inner_boundary_mumps_solver_, inner_boundary_circle_matrix_); +#else + inner_boundary_lu_solver_ = SparseLUSolver(inner_boundary_circle_matrix_); +#endif +} + +SmootherTake::~SmootherTake() +{ +#ifdef GMGPOLAR_USE_MUMPS + finalizeMumpsSolver(inner_boundary_mumps_solver_); +#endif +} diff --git a/src/Smoother/smoother.cpp b/src/Smoother/smoother.cpp new file mode 100644 index 00000000..f8c0d43c --- /dev/null +++ b/src/Smoother/smoother.cpp @@ -0,0 +1,13 @@ +#include "../../include/Smoother/smoother.h" + +Smoother::Smoother(const PolarGrid& grid, const LevelCache& level_cache, const DomainGeometry& domain_geometry, + const DensityProfileCoefficients& density_profile_coefficients, bool DirBC_Interior, + int num_omp_threads) + : grid_(grid) + , level_cache_(level_cache) + , domain_geometry_(domain_geometry) + , density_profile_coefficients_(density_profile_coefficients) + , DirBC_Interior_(DirBC_Interior) + , num_omp_threads_(num_omp_threads) +{ +} \ No newline at end of file diff --git a/src/Stencil/stencil.cpp b/src/Stencil/stencil.cpp new file mode 100644 index 00000000..fdc1b29c --- /dev/null +++ b/src/Stencil/stencil.cpp @@ -0,0 +1,17 @@ +#include "../../include/Stencil/stencil.h" + +Stencil::Stencil(std::initializer_list init) + : values_{} +{ + std::copy(init.begin(), init.end(), values_.begin()); + stencil_size_ = 0; + for (int i = 0; i < static_cast(init.size()); i++) { + if (values_[i] != -1) + stencil_size_++; + } +} + +int Stencil::operator[](StencilPosition type) const +{ + return values_[static_cast(type)]; +} diff --git a/src/build_bi_aniso_rdir_phiper.cpp b/src/build_bi_aniso_rdir_phiper.cpp deleted file mode 100644 index 9aa78b52..00000000 --- a/src/build_bi_aniso_rdir_phiper.cpp +++ /dev/null @@ -1,976 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file build_bi_aniso_rdir_phiper.cpp - * \brief Implementation of the prolongation operators (deprecated) - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "level.h" - -/*! - * \brief Applies the bilinear interpolation - * - * Applies bilinear interpolation for Dirichlet boundary conditions in - * variable r and periodic boundary conditions in phi. Can be used for a - * disk as well as for an annulus. (might be used for other geometries with - * Dirichlet boundary conditions in 'x' and periodic boundary conditions - * in 'y' as well; not tested!) - * - * uses Anisotropic Bilinear Interpolation stencil - * for isotropic mesh, anisotropic stencil reduces to isotropic definition - * ]1 2 1[ - * 1/4 ]2 4 2[ - * ]1 2 1[ - * - * \param u: vector to prolongate/restrict - * \param mc: coarse size of prolongator (level->mc) - * \param ncoarse: fine size of prolongator (level->m) - * \param coarse_r: vector(m), contains -1 if fine nodes, else the coordinate r of coarse nodes (level->coarse_nodes_list_r) - * \param coarse_theta: idem with theta coordinates (level->coarse_nodes_list_theta) - * \param trans: should we prolongate (P) or restrict (R=Pt) - * - */ -std::vector level::apply_prolongation_bi0(std::vector u, int mc, int ncoarse, std::vector coarse_r, - std::vector coarse_theta, int trans) -{ - std::vector Pu; - if (trans == 0) { //Prolongation (P * u = Pu), (m x mc) * mc = m - Pu = std::vector(m, 0); - } - else if (trans == 1) { //Restriction (P^T * u = Pu), (mc x m) * m = mc - Pu = std::vector(mc, 0); - } - - int index = 0; - int start_node_loop = 0; - int max_row_indices_act = 0; - int coarse_index = 0; - - int row_index; - int col_index_base; - int ri, ci; - double vi; - - for (int k = start_node_loop; k < ncoarse; k++) { - - if (coarse_r[k] > -1) { // Coarse Node; no interpolation necessary - - row_index = max_row_indices_act; - col_index_base = coarse_index; - ri = row_index; - ci = col_index_base; // u(r,phi) - vi = 1; // 4/4 - - if (trans) { - Pu[ci] += vi * u[ri]; - } - else - Pu[ri] += vi * u[ci]; - index++; - max_row_indices_act++; - coarse_index++; - } - else { // only fine node - // alt: r0=0/origin_NOT_coarse - int phi_index_prev, r_index_1_prev, r_index_1_next; - int coarse_nodes_prevCirc, coarse_nodes_nexCirc, ncoarse_2prevCirc; - double phi_next, h_prev, h_next, k_prev, k_next; - - if (coarse_r[k - 1] > -1 && - ((k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) || - (k - ntheta_int + 1 >= 0 && coarse_r[k - 1] - coarse_r[k - ntheta_int + 1] == 0))) { - // previous (k-1) and following (either k+1 or k-nphi+1) nodes are coarse and have the same - // radius r; interpolation between u(phi-k) and u(phi+k) - // no periodicity workaround for phi-l since first node (r,0) - // on each circle (where coarse nodes are present) is always coarse! - // periodicity for phi+k handled below - // r_index_1_bef = c(k-1,1)+1; % index in r (starting with 1); r_indices are 0 based otherwise. - - phi_index_prev = coarse_theta[k - 1]; // index one before phi_k - if (k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) - phi_next = theta[coarse_theta[k + 1]]; // index one after phi_k - else - phi_next = 2 * PI; // index one after phi_k (periodic bc come in) - - k_prev = theta[phi_index_prev + 1] - theta[phi_index_prev]; - k_next = phi_next - theta[phi_index_prev + 1]; - - row_index = max_row_indices_act; - - // u(phi-k) - col_index_base = coarse_index; - - ri = row_index; - ci = col_index_base - 1; // u(r,phi-k) (voriger Coarse Node) - vi = k_next / (k_prev + k_next); // 1/2 - - max_row_indices_act = row_index + 1; - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - - // u(phi+k) - ri = row_index; - if (k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) - ci = col_index_base; // u(r,phi+k) (next or currently 'considered' Coarse Node) - else if (coarse_r[k - 1] - coarse_r[k - ntheta_int + 1] == 0) - ci = col_index_base - ceil(ntheta_int / 2); // periodicity - else { - std::cout << "In build_bi_aniso_rDirphiPer (k=" << k << "): should not be entered.\n"; - throw std::runtime_error("In build_bi_aniso_rDirphiPer: should not be entered."); - } - vi = k_prev / (k_prev + k_next); // 1/2 - - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - } - // HERE - else if (coarse_r[k - ntheta_int] > -1 && - coarse_theta[k - ntheta_int] - coarse_theta[k + ntheta_int] == 0) { - - // corresp. coarse nodes with same phi are at r-h and r+h - // interpolation between u(r-h) and u(r+h) - // previous index in r (starting with 1); r_indices are 0 based otherwise. - r_index_1_prev = coarse_r[k - ntheta_int]; - // next index in r (starting with 1); r_indices are 0 based otherwise. - r_index_1_next = coarse_r[k + ntheta_int]; - - if (r_index_1_prev < 0) - h_prev = r[r_index_1_prev + 1] - gyro::dcntl[Param::r0_DB]; - else - h_prev = r[r_index_1_prev + 1] - r[r_index_1_prev]; - if (r_index_1_next + 1 > nr_int) - h_next = gyro::dcntl[Param::R] - r[r_index_1_prev + 1]; - else - h_next = r[r_index_1_next] - r[r_index_1_prev + 1]; - - row_index = max_row_indices_act; - col_index_base = coarse_index; - - // u(r-h) - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_prev > 0) { - coarse_nodes_prevCirc = 0; - for (int i = k - ntheta_int; i < k + 1; i++) - if (coarse_r[i] > -1) - coarse_nodes_prevCirc += 1; - - ri = row_index; - ci = col_index_base - coarse_nodes_prevCirc; // Coarse Node u(r-h,phi) - // not touching boundary, standard case %% if/else with changed values should be bullshit; removing later - vi = h_next / (h_prev + h_next); // 1/2 - max_row_indices_act = row_index + 1; // update max - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - } - - // u(r+h) - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_next + 1 < nr_int) { - coarse_nodes_nexCirc = 0; - for (int i = k; i < k + ntheta_int + 1; i++) - if (coarse_r[i] > -1) - coarse_nodes_nexCirc += 1; - ri = row_index; - ci = col_index_base + coarse_nodes_nexCirc - 1; // u(r+h,phi) - // not touching boundary, standard case %% if/else with changed values should be bullshit; removing later - vi = h_prev / (h_prev + h_next); // 1/2 - - max_row_indices_act = row_index + 1; // update max - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - } - // weighing with 1/4 from all 'diagonally adjacent' coarse node - // for standard coarsening this is in fact 0.5x the previous interpolated fine node - // plus 0.5x the next (...taking periodicity into account!) interpolated fine node - // ...thus take formula from previous elseif and change - // correspondingly. - } - else { - // previous index in r (starting with 1); r_indices are 0 based otherwise. - - r_index_1_prev = coarse_r[k - ntheta_int - 1]; - // next index in r (starting with 1); r_indices are 0 based otherwise - // (take -1 instead of +1 (attention to periodic BC!) to not go one circle to far) - r_index_1_next = coarse_r[k + ntheta_int - 1]; - - // index one before phi_k (access is possible via 'k-nphi-1' since subsequent if should never be entered) - phi_index_prev = coarse_theta[k - ntheta_int - 1]; - - // means that first node on r-circle with (r,phi)=(r,0) is a fine node and does not have adjacent coarse nodes at (r-h,0) and (r+h,0) - // [jump across periodic bc had to be respected; not implemented; must and shall not appear with current coarsening] - if (std::min(coarse_theta[k - ntheta_int - 1], coarse_theta[k - ntheta_int + 1]) > -1 && - coarse_theta[k - ntheta_int - 1] > coarse_theta[k - ntheta_int + 1]) - std::cout << "WARNING: Coarsening strategy has to be adapted for bilinear interpolation\n"; - if (phi_index_prev + 1 < ntheta_int - 1) - phi_next = theta[coarse_theta[k + ntheta_int + 1]]; // index one after phi_k - else - phi_next = 2 * PI; // index one after phi_k (periodic bc come in) - - if (r_index_1_prev < 0) - h_prev = r[r_index_1_prev + 1] - gyro::dcntl[Param::r0_DB]; // h_{i-1} - else - h_prev = r[r_index_1_prev + 1] - r[r_index_1_prev]; // h_{i-1} - if (r_index_1_next + 1 > nr_int) - h_next = gyro::dcntl[Param::R] - r[r_index_1_prev + 1]; // h_{i} - else - h_next = r[r_index_1_next] - r[r_index_1_prev + 1]; // h_{i} - - k_prev = theta[phi_index_prev + 1] - theta[phi_index_prev]; - k_next = phi_next - theta[phi_index_prev + 1]; - - row_index = max_row_indices_act; - col_index_base = coarse_index; - - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_prev > 0) { - // u(r-h,phi-h) - coarse_nodes_prevCirc = 0; - for (int i = k - ntheta_int - 1; i < k; i++) - if (coarse_r[i] > -1) - coarse_nodes_prevCirc += 1; - - ri = row_index; - ci = col_index_base - coarse_nodes_prevCirc; // Coarse Node u(r-h,phi-h) - vi = h_next * k_next / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - max_row_indices_act = row_index + 1; // update max - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - - // u(r-h,phi+h) - ri = row_index; - // coarse node at (r-h,phi-h) is at phi=nphi-1, so 'next' coarse - // node at (r-h,phi+h) is at (r-h,0) since phi=2pi-h - // %%%%%%%%%%%%%%%%%%%%%%%%% Hier Fehler k-2*nphi:k=0,.... - if (coarse_theta[k - 1 - ntheta_int] + 1 == ntheta_int - 1) { - ncoarse_2prevCirc = 0; - for (int i = k - 2 * ntheta_int + 1; i < k - 1; i++) - if (coarse_r[i] > -1) - ncoarse_2prevCirc += 1; - ci = col_index_base - ncoarse_2prevCirc; // Coarse Node u(r-h,phi+h) - } - else - ci = col_index_base - coarse_nodes_prevCirc + 1; // Coarse Node u(r-h,phi+h) - // not touching boundary, standard case - vi = h_next * k_prev / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - } - - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_next + 1 < nr_int) { - // u(r+h,phi-h) - coarse_nodes_nexCirc = 0; - for (int i = k + 1; i < k + ntheta_int + 1; i++) { - if (coarse_r[i] > -1) - coarse_nodes_nexCirc += 1; - } - - ri = row_index; - ci = col_index_base + coarse_nodes_nexCirc - 1; // u(r+h,phi-h) - vi = h_prev * k_next / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - max_row_indices_act = row_index + 1; // update max - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - - // u(r+h,phi+h) - ri = row_index; - // 'next' coarse node at (..,phi+h) is at (..,0) since phi=2pi-h; - // corresp. index equals coarse_index since this is the index of the next coarse node - if (coarse_theta[k - 1 - ntheta_int] + 1 == ntheta_int - 1) - ci = col_index_base; // u(r+h,phi-h) - else - ci = col_index_base + coarse_nodes_nexCirc; // u(r+h,phi-h) - vi = h_prev * k_prev / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - } - } - } - } - - return Pu; -} /* ----- end of level::apply_prolongation_bi0 ----- */ - -/*! - * \brief Applies the injection - * - * Applies injection: directly inject values of coarse nodes. - * Just uses values 1.0 for nodes of type 0. - * - * \param u: vector to prolongate/restrict - * \param mc: coarse size of prolongator (level->mc) - * \param ncoarse: fine size of prolongator (level->m) - * \param coarse_r: vector(m), contains -1 if fine nodes, else the coordinate r of coarse nodes (level->coarse_nodes_list_r) - * \param coarse_theta: idem with theta coordinates (level->coarse_nodes_list_theta) - * \param trans: should we prolongate (P) or restrict (R=Pt) - * - */ -std::vector level::apply_prolongation_inj0(std::vector u, int mc, int ncoarse, - std::vector coarse_r, std::vector coarse_theta, int trans) -{ - std::vector Pu; - if (trans == 0) { //Prolongation (P * u = Pu), (m x mc) * mc = m - Pu = std::vector(m, 0); - } - else if (trans == 1) { //Restriction (P^T * u = Pu), (mc x m) * m = mc - Pu = std::vector(mc, 0); - } - - // Beware ! we only consider the m-th first elements in ncoarse_lists_*: - // ncoarse_lists{i+1}(nodes_remain{i},:) - - int index = 0; - // alt: r0=0/origin_NOT_coarse - int start_node_loop = 0; - int max_row_indices_act = 0; - int coarse_index = 0; - - int row_index; - int col_index_base; - int ri, ci; - double vi; - - for (int k = start_node_loop; k < ncoarse; k++) { - //! CASE 1: Coarse Node; no interpolation necessary - if (coarse_r[k] > -1) { // Coarse Node; no interpolation necessary - - row_index = max_row_indices_act; - col_index_base = coarse_index; - ri = row_index; - ci = col_index_base; // u(r,phi) - vi = 1.0; // 4/4 - - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - max_row_indices_act++; - coarse_index++; - } - else { // only fine node - // alt: r0=0/origin_NOT_coarse - int phi_index_prev, r_index_1_prev, r_index_1_next; - int coarse_nodes_prevCirc, coarse_nodes_nexCirc, ncoarse_2prevCirc; - double phi_next, h_prev, h_next, k_prev, k_next; - - //! CASE 2 - if (coarse_r[k - 1] > -1 && - ((k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) || - (k - ntheta_int + 1 >= 0 && coarse_r[k - 1] - coarse_r[k - ntheta_int + 1] == 0))) { - // previous (k-1) and following (either k+1 or k-nphi+1) nodes are coarse and have the same - // radius r; interpolation between u(phi-k) and u(phi+k) - // no periodicity workaround for phi-l since first node (r,0) - // on each circle (where coarse nodes are present) is always coarse! - // periodicity for phi+k handled below - // r_index_1_bef = c(k-1,1)+1; % index in r (starting with 1); r_indices are 0 based otherwise. - - phi_index_prev = coarse_theta[k - 1]; // index one before phi_k - if (k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) - phi_next = theta[coarse_theta[k + 1]]; // index one after phi_k - else - phi_next = 2 * PI; // index one after phi_k (periodic bc come in) - - k_prev = theta[phi_index_prev + 1] - theta[phi_index_prev]; - k_next = phi_next - theta[phi_index_prev + 1]; - - row_index = max_row_indices_act; - - //! u(phi-k) - col_index_base = coarse_index; - - ri = row_index; - ci = col_index_base - 1; // u(r,phi-k) (voriger Coarse Node) - vi = k_next / (k_prev + k_next); // 1/2 - - max_row_indices_act = row_index + 1; - index++; - - //! u(phi+k) - ri = row_index; - if (k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) - ci = col_index_base; // u(r,phi+k) (next or currently 'considered' Coarse Node) - else if (coarse_r[k - 1] - coarse_r[k - ntheta_int + 1] == 0) - ci = col_index_base - ceil(ntheta_int / 2); // periodicity - else { - std::cout << "In build_bi_aniso_rDirphiPer (k=" << k << "): should not be entered.\n"; - throw std::runtime_error("In build_bi_aniso_rDirphiPer: should not be entered."); - } - vi = k_prev / (k_prev + k_next); // 1/2 - - index++; - } - //! CASE 3 - else if (coarse_r[k - ntheta_int] > -1 && - coarse_theta[k - ntheta_int] - coarse_theta[k + ntheta_int] == 0) { - - // corresp. coarse nodes with same phi are at r-h and r+h - // interpolation between u(r-h) and u(r+h) - // previous index in r (starting with 1); r_indices are 0 based otherwise. - r_index_1_prev = coarse_r[k - ntheta_int]; - // next index in r (starting with 1); r_indices are 0 based otherwise. - r_index_1_next = coarse_r[k + ntheta_int]; - - if (r_index_1_prev < 0) - h_prev = r[r_index_1_prev + 1] - gyro::dcntl[Param::r0_DB]; - else - h_prev = r[r_index_1_prev + 1] - r[r_index_1_prev]; - if (r_index_1_next + 1 > nr_int) - h_next = gyro::dcntl[Param::R] - r[r_index_1_prev + 1]; - else - h_next = r[r_index_1_next] - r[r_index_1_prev + 1]; - - row_index = max_row_indices_act; - col_index_base = coarse_index; - - //! u(r-h) - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_prev > 0) { - coarse_nodes_prevCirc = 0; - for (int i = k - ntheta_int; i < k + 1; i++) - if (coarse_r[i] > -1) - coarse_nodes_prevCirc += 1; - ri = row_index; - ci = col_index_base - coarse_nodes_prevCirc; // Coarse Node u(r-h,phi) - // not touching boundary, standard case %% if/else with changed values should be bullshit; removing later - vi = h_next / (h_prev + h_next); // 1/2 - max_row_indices_act = row_index + 1; // update max - index++; - } - - //! u(r+h) - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_next + 1 < nr_int) { - coarse_nodes_nexCirc = 0; - for (int i = k; i < k + ntheta_int + 1; i++) - if (coarse_r[i] > -1) - coarse_nodes_nexCirc += 1; - ri = row_index; - ci = col_index_base + coarse_nodes_nexCirc - 1; // u(r+h,phi) - // not touching boundary, standard case %% if/else with changed values should be bullshit; removing later - vi = h_prev / (h_prev + h_next); // 1/2 - - max_row_indices_act = row_index + 1; // update max - index++; - } - // weighing with 1/4 from all 'diagonally adjacent' coarse node - // for standard coarsening this is in fact 0.5x the previous interpolated fine node - // plus 0.5x the next (...taking periodicity into account!) interpolated fine node - // ...thus take formula from previous elseif and change - // correspondingly. - } - //! CASE 4 - else { - // previous index in r (starting with 1); r_indices are 0 based otherwise. - - r_index_1_prev = coarse_r[k - ntheta_int - 1]; - // next index in r (starting with 1); r_indices are 0 based otherwise - // (take -1 instead of +1 (attention to periodic BC!) to not go one circle to far) - r_index_1_next = coarse_r[k + ntheta_int - 1]; - - // index one before phi_k (access is possible via 'k-nphi-1' since subsequent if should never be entered) - phi_index_prev = coarse_theta[k - ntheta_int - 1]; - - // means that first node on r-circle with (r,phi)=(r,0) is a fine node and does not have adjacent coarse nodes at (r-h,0) and (r+h,0) - // [jump across periodic bc had to be respected; not implemented; must and shall not appear with current coarsening] - if (std::min(coarse_theta[k - ntheta_int - 1], coarse_theta[k - ntheta_int + 1]) > -1 && - coarse_theta[k - ntheta_int - 1] > coarse_theta[k - ntheta_int + 1]) - std::cout << "WARNING: Coarsening strategy has to be adapted for bilinear interpolation\n"; - if (phi_index_prev + 1 < ntheta_int - 1) - phi_next = theta[coarse_theta[k + ntheta_int + 1]]; // index one after phi_k - else - phi_next = 2 * PI; // index one after phi_k (periodic bc come in) - - if (r_index_1_prev < 0) - h_prev = r[r_index_1_prev + 1] - gyro::dcntl[Param::r0_DB]; // h_{i-1} - else - h_prev = r[r_index_1_prev + 1] - r[r_index_1_prev]; // h_{i-1} - if (r_index_1_next + 1 > nr_int) - h_next = gyro::dcntl[Param::R] - r[r_index_1_prev + 1]; // h_{i} - else - h_next = r[r_index_1_next] - r[r_index_1_prev + 1]; // h_{i} - - k_prev = theta[phi_index_prev + 1] - theta[phi_index_prev]; - k_next = phi_next - theta[phi_index_prev + 1]; - - row_index = max_row_indices_act; - col_index_base = coarse_index; - - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_prev > 0) { - // u(r-h,phi-h) - coarse_nodes_prevCirc = 0; - for (int i = k - ntheta_int - 1; i < k; i++) - if (coarse_r[i] > -1) - coarse_nodes_prevCirc += 1; - - ri = row_index; - ci = col_index_base - coarse_nodes_prevCirc; // Coarse Node u(r-h,phi-h) - vi = h_next * k_next / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - max_row_indices_act = row_index + 1; // update max - index++; - - // u(r-h,phi+h) - ri = row_index; - // coarse node at (r-h,phi-h) is at phi=nphi-1, so 'next' coarse - // node at (r-h,phi+h) is at (r-h,0) since phi=2pi-h - // %%%%%%%%%%%%%%%%%%%%%%%%% Hier Fehler k-2*nphi:k=0,.... - if (coarse_theta[k - 1 - ntheta_int] + 1 == ntheta_int - 1) { - ncoarse_2prevCirc = 0; - for (int i = k - 2 * ntheta_int + 1; i < k - 1; i++) - if (coarse_r[i] > -1) - ncoarse_2prevCirc += 1; - ci = col_index_base - ncoarse_2prevCirc; // Coarse Node u(r-h,phi+h) - } - else - ci = col_index_base - coarse_nodes_prevCirc + 1; // Coarse Node u(r-h,phi+h) - // not touching boundary, standard case - vi = h_next * k_prev / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - index++; - } - - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_next + 1 < nr_int) { - // u(r+h,phi-h) - coarse_nodes_nexCirc = 0; - for (int i = k + 1; i < k + ntheta_int + 1; i++) { - if (coarse_r[i] > -1) - coarse_nodes_nexCirc += 1; - } - - ri = row_index; - ci = col_index_base + coarse_nodes_nexCirc - 1; // u(r+h,phi-h) - vi = h_prev * k_next / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - - max_row_indices_act = row_index + 1; // update max - index++; - - // u(r+h,phi+h) - ri = row_index; - // 'next' coarse node at (..,phi+h) is at (..,0) since phi=2pi-h; - // corresp. index equals coarse_index since this is the index of the next coarse node - if (coarse_theta[k - 1 - ntheta_int] + 1 == ntheta_int - 1) - ci = col_index_base; // u(r+h,phi-h) - else - ci = col_index_base + coarse_nodes_nexCirc; // u(r+h,phi-h) - vi = h_prev * k_prev / ((k_prev + k_next) * (h_prev + h_next)); // isotrop: 1/4 - index++; - } - } - } - } - - return Pu; -} /* ----- end of level::apply_prolongation_inj0 ----- */ - -/*! - * \brief Applies the extrapolation operator - * - * Applies the prolongation operator for implicit extrapolation. - * - * The stencil is the same as the isotropic bilinear interpolation stencil, - * except for fine points with diagonal coarse neighboors (types 5,6,7) where only - * top_left and top_right values are used. - * - * \param u: vector to prolongate/restrict - * \param mv: coarse size of prolongator (level->mc) - * \param ncoarse: fine size of prolongator (level->m) - * \param coarse_r: vector(m), contains -1 if fine nodes, else the coordinate r of coarse nodes (level->coarse_nodes_list_r) - * \param coarse_theta: idem with theta coordinates (level->coarse_nodes_list_theta) - * \param trans: should we prolongate (P) or restrict (R=Pt) - * - */ -std::vector level::apply_prolongation_ex0(std::vector u, int mc, int ncoarse, std::vector coarse_r, - std::vector coarse_theta, int trans) -{ - std::vector Pu; - if (trans == 0) { //Prolongation (P * u = Pu), (m x mc) * mc = m - Pu = std::vector(m, 0); - } - else if (trans == 1) { //Restriction (P^T * u = Pu), (mc x m) * m = mc - Pu = std::vector(mc, 0); - } - - // Beware ! we only consider the m-th first elements in ncoarse_lists_*: - // ncoarse_lists{i+1}(nodes_remain{i},:) - - int index = 0; - int start_node_loop = 0; - int max_row_indices_act = 0; - int coarse_index = 0; - - int row_index; - int col_index_base; - int ri, ci; - double vi; - - for (int k = start_node_loop; k < ncoarse; k++) { - //! CASE 1: Coarse Node; no interpolation necessary (coarse node = fine node) - if (coarse_r[k] > -1) { // Coarse Node; no interpolation necessary - - row_index = max_row_indices_act; - col_index_base = coarse_index; - ri = row_index; - ci = col_index_base; // u(r,phi) - vi = 1.0; // 4/4 - - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - index++; - max_row_indices_act++; - coarse_index++; - } - else { // only fine nodes - //check if the fine node has a diagonal link to a coarse node - int diagonal_link = 0; //indicates wheather a fine node has a diagonal link or not - int i = k % ntheta_int; - int j = floor(k / ntheta_int); - if (i % 2 == 1 && j % 2 == 1) - diagonal_link = 1; - - // alt: r0=0/origin_NOT_coarse - int phi_index_prev, r_index_1_prev, r_index_1_next; - int coarse_nodes_prevCirc, coarse_nodes_nexCirc, ncoarse_2prevCirc; - double phi_next, h_prev, h_next, k_prev, k_next; - - //! CASE 2: fine nodes which have coarse points to the right and to the left - if (coarse_r[k - 1] > -1 && - ((k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) || - (k - ntheta_int + 1 >= 0 && coarse_r[k - 1] - coarse_r[k - ntheta_int + 1] == 0))) { - // previous (k-1) and following (either k+1 or k-nphi+1) nodes are coarse and have the same - // radius r; interpolation between u(phi-k) and u(phi+k) - // no periodicity workaround for phi-l since first node (r,0) - // on each circle (where coarse nodes are present) is always coarse! - // periodicity for phi+k handled below - // r_index_1_bef = c(k-1,1)+1; % index in r (starting with 1); r_indices are 0 based otherwise. - - phi_index_prev = coarse_theta[k - 1]; // index one before phi_k - if (k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) - phi_next = theta[coarse_theta[k + 1]]; // index one after phi_k - else - phi_next = 2 * PI; // index one after phi_k (periodic bc come in) - - k_prev = theta[phi_index_prev + 1] - theta[phi_index_prev]; - k_next = phi_next - theta[phi_index_prev + 1]; - - row_index = max_row_indices_act; - - //! u(phi-k) (left) - col_index_base = coarse_index; - - ri = row_index; - ci = col_index_base - 1; // u(r,phi-k) (voriger Coarse Node) - vi = 0.5; - - max_row_indices_act = row_index + 1; - if (diagonal_link == 0) { - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - } - index++; - - // u(phi+k) (right) - ri = row_index; - if (k + 1 < ncoarse && coarse_r[k - 1] - coarse_r[k + 1] == 0) - ci = col_index_base; // u(r,phi+k) (next or currently 'considered' Coarse Node) - else if (coarse_r[k - 1] - coarse_r[k - ntheta_int + 1] == 0) - ci = col_index_base - ceil(ntheta_int / 2); // periodicity - else { - std::cout << "In build_bi_aniso_rDirphiPer (k=" << k << "): should not be entered.\n"; - throw std::runtime_error("In build_bi_aniso_rDirphiPer: should not be entered."); - } - vi = 0.5; - - if (diagonal_link == 0) { - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - } - index++; - } - //! CASE 3: fine nodes which have coarse points at the top and bottom side - else if (coarse_r[k - ntheta_int] > -1 && - coarse_theta[k - ntheta_int] - coarse_theta[k + ntheta_int] == 0) { - - // corresp. coarse nodes with same phi are at r-h and r+h - // interpolation between u(r-h) and u(r+h) - // previous index in r (starting with 1); r_indices are 0 based otherwise. - r_index_1_prev = coarse_r[k - ntheta_int]; - // next index in r (starting with 1); r_indices are 0 based otherwise. - r_index_1_next = coarse_r[k + ntheta_int]; - - if (r_index_1_prev < 0) - h_prev = r[r_index_1_prev + 1] - gyro::dcntl[Param::r0_DB]; - else - h_prev = r[r_index_1_prev + 1] - r[r_index_1_prev]; - if (r_index_1_next + 1 > nr_int) - h_next = gyro::dcntl[Param::R] - r[r_index_1_prev + 1]; - else - h_next = r[r_index_1_next] - r[r_index_1_prev + 1]; - - row_index = max_row_indices_act; - col_index_base = coarse_index; - - //! u(r-h) (bottom) - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_prev > 0) { - coarse_nodes_prevCirc = 0; - for (int i = k - ntheta_int; i < k + 1; i++) - if (coarse_r[i] > -1) - coarse_nodes_prevCirc += 1; - - ri = row_index; - ci = col_index_base - coarse_nodes_prevCirc; // Coarse Node u(r-h,phi) - vi = 0.5; - - max_row_indices_act = row_index + 1; // update max - if (diagonal_link == 0) { - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - } - index++; - } - - //! u(r+h) (top) - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_next + 1 < nr_int) { - coarse_nodes_nexCirc = 0; - for (int i = k; i < k + ntheta_int + 1; i++) - if (coarse_r[i] > -1) - coarse_nodes_nexCirc += 1; - ri = row_index; - ci = col_index_base + coarse_nodes_nexCirc - 1; // u(r+h,phi) - vi = h_prev / (h_prev + h_next); // 1/2 - vi = 0.5; - - max_row_indices_act = row_index + 1; // update max - if (diagonal_link == 0) { - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - } - index++; - } - // weighing with 1/4 from all 'diagonally adjacent' coarse node - // for standard coarsening this is in fact 0.5x the previous interpolated fine node - // plus 0.5x the next (...taking periodicity into account!) interpolated fine node - // ...thus take formula from previous elseif and change - // correspondingly. - } - //! CASE 4: fine nodes which have coarse points only diagonally - else { - // previous index in r (starting with 1); r_indices are 0 based otherwise. - - r_index_1_prev = coarse_r[k - ntheta_int - 1]; - // next index in r (starting with 1); r_indices are 0 based otherwise - // (take -1 instead of +1 (attention to periodic BC!) to not go one circle to far) - r_index_1_next = coarse_r[k + ntheta_int - 1]; - - // index one before phi_k (access is possible via 'k-nphi-1' since subsequent if should never be entered) - phi_index_prev = coarse_theta[k - ntheta_int - 1]; - - // means that first node on r-circle with (r,phi)=(r,0) is a fine node and does not have adjacent coarse nodes at (r-h,0) and (r+h,0) - // [jump across periodic bc had to be respected; not implemented; must and shall not appear with current coarsening] - if (std::min(coarse_theta[k - ntheta_int - 1], coarse_theta[k - ntheta_int + 1]) > -1 && - coarse_theta[k - ntheta_int - 1] > coarse_theta[k - ntheta_int + 1]) - std::cout << "WARNING: Coarsening strategy has to be adapted for bilinear interpolation\n"; - if (phi_index_prev + 1 < ntheta_int - 1) - phi_next = theta[coarse_theta[k + ntheta_int + 1]]; // index one after phi_k - else - phi_next = 2 * PI; // index one after phi_k (periodic bc come in) - - if (r_index_1_prev < 0) - h_prev = r[r_index_1_prev + 1] - gyro::dcntl[Param::r0_DB]; // h_{i-1} - else - h_prev = r[r_index_1_prev + 1] - r[r_index_1_prev]; // h_{i-1} - if (r_index_1_next + 1 > nr_int) - h_next = gyro::dcntl[Param::R] - r[r_index_1_prev + 1]; // h_{i} - else - h_next = r[r_index_1_next] - r[r_index_1_prev + 1]; // h_{i} - - k_prev = theta[phi_index_prev + 1] - theta[phi_index_prev]; - k_next = phi_next - theta[phi_index_prev + 1]; - - row_index = max_row_indices_act; - col_index_base = coarse_index; - - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_prev > 0) { - //! u(r-h,phi-h) (bottom left) - coarse_nodes_prevCirc = 0; - for (int i = k - ntheta_int - 1; i < k; i++) - if (coarse_r[i] > -1) - coarse_nodes_prevCirc += 1; - - ri = row_index; - ci = col_index_base - coarse_nodes_prevCirc; // Coarse Node u(r-h,phi-h) - vi = 0.5; - - max_row_indices_act = row_index + 1; // update max - if (diagonal_link == -1) { //should not be treated - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - } - index++; - - //! u(r-h,phi+h) (bottom right) - ri = row_index; - // coarse node at (r-h,phi-h) is at phi=nphi-1, so 'next' coarse - // node at (r-h,phi+h) is at (r-h,0) since phi=2pi-h - // %%%%%%%%%%%%%%%%%%%%%%%%% Hier Fehler k-2*nphi:k=0,.... - if (coarse_theta[k - 1 - ntheta_int] + 1 == ntheta_int - 1) { - ncoarse_2prevCirc = 0; - for (int i = k - 2 * ntheta_int + 1; i < k - 1; i++) - if (coarse_r[i] > -1) - ncoarse_2prevCirc += 1; - ci = col_index_base - ncoarse_2prevCirc; // Coarse Node u(r-h,phi+h) - } - else - ci = col_index_base - coarse_nodes_prevCirc + 1; // Coarse Node u(r-h,phi+h) - // not touching boundary, standard case - vi = 0.5; - - if (diagonal_link == 1) { - if (trans) { - Pu[ci] += vi * u[ri]; - } - else { - Pu[ri] += vi * u[ci]; - } - } - index++; - } - - // do not introduce interactions between interior nodes and boundary nodes. - // Correction of boundary to interior zero anyway (since residual is zero); - // introduction of interior values to boundary nodes is not intended, so do not do it ! - if (r_index_1_next + 1 < nr_int) { - //! u(r+h,phi-h) (top left) - coarse_nodes_nexCirc = 0; - for (int i = k + 1; i < k + ntheta_int + 1; i++) { - if (coarse_r[i] > -1) - coarse_nodes_nexCirc += 1; - } - - ri = row_index; - ci = col_index_base + coarse_nodes_nexCirc - 1; // u(r+h,phi-h) - vi = 0.5; - - max_row_indices_act = row_index + 1; // update max - if (diagonal_link == 1) { - if (trans) { - Pu[ci] += vi * u[ri]; - } - else { - Pu[ri] += vi * u[ci]; - } - } - index++; - - //! u(r+h,phi+h) (top right) - ri = row_index; - // 'next' coarse node at (..,phi+h) is at (..,0) since phi=2pi-h; - // corresp. index equals coarse_index since this is the index of the next coarse node - if (coarse_theta[k - 1 - ntheta_int] + 1 == ntheta_int - 1) - ci = col_index_base; // u(r+h,phi-h) - else - ci = col_index_base + coarse_nodes_nexCirc; // u(r+h,phi-h) - vi = 0.5; - - if (diagonal_link == -1) { //should not be treated - if (trans) - Pu[ci] += vi * u[ri]; - else - Pu[ri] += vi * u[ci]; - } - index++; - } - } - } - } - - return Pu; -} /* ----- end of level::apply_prolongation_ex0 ----- */ \ No newline at end of file diff --git a/src/build_fd9star_anisotr_scaled.cpp b/src/build_fd9star_anisotr_scaled.cpp deleted file mode 100644 index a8abecd4..00000000 --- a/src/build_fd9star_anisotr_scaled.cpp +++ /dev/null @@ -1,954 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file build_fd9star_anisotr_scaled.cpp - * \brief Implementation of the 9p FD operators A and RHS (deprecated) - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "level.h" - -/*! - * \brief Build the operator and RHS (deprecated) - * - * Builds the matrix A and the RHS of the system based on 9p FD. Relations with - * Dirichlet boundary condition nodes are shifted to the RHS to keep a symmetric - * operator. - * - * everything expressed in polar coordinates - * allows anisotropy in r - * - r: array of discretized r values - * - ntheta: number of discretization intervals in angle phi (also variable m) - * - * solves the transformed DGL: r*u_rr + u_r + 1/r*u_phiphi = rf fuer r>0, r<=1, - * fuer r=0, approximate: u_0 = 1/m sum_j u(h,jk)-(h/2)^2*f - * sorting of nodes ringwise. first node origin, last ntheta - * Node all the way out - * - */ -void level::build_A0() -{ - // if boundary is only defined on radius, checks for wrongly detected boundary - // nodes due to rounding errors (double checking...) - double tol_bound_check = gyro::dcntl[Param::tol_bound_check]; - // double x, y; - int index; - - // Take boundary condition into account - // In the operator - // gyro::trafo(r[0], theta[0], x, y, 0); - // alt: r0=0/neumBound - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { - // Dirichlet-RB (intérieur ; premier noeud dans la numérotation des disques) - for (int i = 0; i < ntheta_int; i++) { - row_indices.push_back(i); - col_indices.push_back(i); - vals.push_back(1.0); - } - index = ntheta_int; - } - else { - index = 0; - } - - // gyro::trafo(r[0], theta[0], x, y, 0); - // alt: r0=0/neumBound - int start_j = 0; - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { - start_j = 1; - } - // dirBound([r(1),0])>0 means that (r(1),0) is not on Dirichlet boundary - else if (r[0] > 0 && fabs(gyro::distBoundary(r[0], theta[0], 0)) > tol_bound_check) { - start_j = 0; - } - - // int i1 = 0, i2 = 0; - for (int j = start_j; j < nr_int; j++) { // nodes of Disk K(eps,1-eps) - for (int i = 0; i < ntheta_int; i++) { - // alt: r0=0 - int row_index = j * ntheta_int + i; - - // % ==================== % - double kt = thetaplus[i]; - double thetamin1, ktmin1, hs, hsmin1; - if (i > 0) { - thetamin1 = theta[i - 1]; - ktmin1 = thetaplus[i - 1]; - } - else { - thetamin1 = theta[ntheta_int - 1]; // equal to 2*PI-ktmin1 - ktmin1 = thetaplus[ntheta_int - 1]; - } - // % -------------------- % - // r(j+1) is the current r - hs = hplus[j]; - if (j > 0) - hsmin1 = hplus[j - 1]; - else - hsmin1 = 2 * r[0]; // across the origin - // % ==================== % - - // 9-Point Stencil (attention order; first bottom, then right, then top right, top left, bottom left, middle) - // r-h- (h- = x_i-x_i-1) - // if (j == 1) - // gyro::trafo(r[j - 1], theta[i], x, y, 0); - - // j=1 means r-h is on the boundary, dirBound([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) - // --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && fabs(gyro::distBoundary(r[j - 1], theta[i], 0)) < tol_bound_check) { - } - else { - // row_indices[index] = row_index; - row_indices.push_back(row_index); - col_indices.push_back(-42); - vals.push_back(-42); - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) - if (j > 1 || (j == 1 && r[0] > 0)) - // to u at r-h geometrically recorded (i.e. -ntheta_int nodes at slice sorting) - col_indices[index] = row_index - ntheta_int; - else { // j=0 or j=1 - if (r[0] == 0) { // all refering to the single origin node! (j=0 not possible in this case) - // Reference to u at r-h=0 geometrically recorded (for all i the origin, because here r=h) - col_indices[index] = 1; - } - else if (j == 0) { // across the origin - if (i + 1 > ntheta_int / 2) { - col_indices[index] = row_index - ntheta_int / 2; // half a turn back - } - else { - col_indices[index] = row_index + ntheta_int / 2; // half a turn further - } - } - } - - if (j > 0) { - // alt: neumBC - // a l interieur sans contact aux conditions aux limites - vals[index] = - -0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)); - } - else { - // j==0; across the origin - // just use r_{s-1}=0 - // Use r(0):=r(j) to go to the other side of the origin - vals[index] = - -0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)); - } - index++; - } - - // (r-h-,phi-k) (en bas a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - // if (j == 1) // coords necessary for potential boundary conditions - // gyro::trafo(r[j - 1], thetamin1, x, y, 0); // r(j) is PREVIOUS r, actual is r(J+1) ! - // j=1 means r-h is on the boundary, dirBound([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) - // --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && fabs(gyro::distBoundary(r[j - 1], thetamin1, 0)) < tol_bound_check) { - } - else { - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) - // but no dirichlet bc on innermost circle - if (j > 1 || (j == 1 && r[0] > 0)) { - row_indices.push_back(row_index); - if (i > 0) // next node in theta direction but one circle before - col_indices.push_back(row_index - ntheta_int - 1); - else // periodicity condition - col_indices.push_back(row_index - 1); - } - - // if j > 0 - // alt: neumBound - if (j > 1 || (j == 1 && r[0] > 0)) { - // a l interieur sans contact aux conditions aux limites - // if (j > 1) // pas de reference vers l origine ici - vals.push_back(-(gyro::art(r[j], thetamin1, 0) + gyro::art(r[j - 1], theta[i], 0))); - index++; - } - } - } - - // phi-k - // row_indices[index] = row_index; - row_indices.push_back(row_index); - if (i > 0) // previous node in phi direction - col_indices.push_back(row_index - 1); - else // periodicity condition - col_indices.push_back(row_index + ntheta_int - 1); - vals.push_back(-0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) - - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0))); - index++; - - // (r+h+,phi-k) (en haut a droite) - if (gyro::icntl[Param::mod_pk] > 0) { - double theta_eval_prelast = 0; - double r_tmp, theta_tmp; - if (i > 0) { // not the first node on the corresponding circle; we can take theta(i-1) - // gyro::trafo(r[j + 1], theta[i - 1], x, y, 0); - r_tmp = r[j + 1]; - theta_tmp = theta[i - 1]; - } - else { - theta_eval_prelast = theta[ntheta_int - 1]; - // gyro::trafo(r[j + 1], theta_eval_prelast, x, y, 0); - r_tmp = r[j + 1]; - theta_tmp = theta_eval_prelast; - } - - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1 || - (j == nr_int - 1 && fabs(gyro::distBoundary(r_tmp, theta_tmp, 0)) > tol_bound_check)) { - // row_indices[index] = row_index; - row_indices.push_back(row_index); - if (i > 0) // previous node in phi direction but at r+h - col_indices.push_back(row_index + ntheta_int - 1); - else // first node on corresponding circle; pay gyro::attention to periodicity condition! - col_indices.push_back(row_index + 2 * ntheta_int - 1); - vals.push_back(gyro::art(r[j], thetamin1, 0) + gyro::art(r[j + 1], theta[i], 0)); - index++; - } - } - - // // r + h+ (h+ = x_i+1-x_i) - // gyro::trafo(r[j + 1], theta[i], x, y, 0); - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1 || - (j == nr_int - 1 && fabs(gyro::distBoundary(r[j + 1], theta[i], 0)) > tol_bound_check)) { - row_indices.push_back(row_index); - col_indices.push_back(row_index + ntheta_int); // zu u bei r+h - vals.push_back(-0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) - - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0))); - index++; - } - - // (r+h+,phi+k) (en haut a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - double thetap1 = 0; - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - - // gyro::trafo(r[j + 1], thetap1, x, y, 0); ??? - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1 || - (j == nr_int - 1 && fabs(gyro::distBoundary(r[j + 1], theta[i], 0)) > tol_bound_check)) { - row_indices.push_back(row_index); - if (i + 1 < ntheta_int) // previous node in phi direction but at r+h - col_indices.push_back(row_index + ntheta_int + 1); - else // first node on corresponding circle; pay gyro::attention to periodicity condition! - col_indices.push_back(row_index + 1); - vals.push_back(-gyro::art(r[j + 1], theta[i], 0) - gyro::art(r[j], thetap1, 0)); - index++; - } - } - - // phi+k - double thetap1, r_tmp, theta_tmp; - // row_indices[index] = row_index; - row_indices.push_back(row_index); - if (i + 1 < ntheta_int) // next node in theta direction - col_indices.push_back(row_index + 1); - else // periodicity condition - col_indices.push_back(row_index - ntheta_int + 1); - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - vals.push_back(-0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) - - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0))); - index++; - - // (r-h-,phi+k) (en bas a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - if (j == 1) { // coords necessary for potential boundary conditions - if (i + 1 < ntheta_int) { - // gyro::trafo(r[j - 1], theta[i + 1], x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = theta[i + 1]; - } - else { - double pi2 = 2 * PI; - // gyro::trafo(r[j - 1], pi2, x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = pi2; - } - } - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - // j=1 means r-h is on the boundary, gyro::distBoundary([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && fabs(gyro::distBoundary(r_tmp, theta_tmp, 0)) < tol_bound_check) { - } - else { - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) but no dirichlet bc on innermost circle - if (j > 1 || (j == 1 && r[0] > 0)) { - row_indices.push_back(row_index); - if (i + 1 < ntheta_int) // next node in theta direction but one circle before - col_indices.push_back(row_index - ntheta_int + 1); - else { // periodicity condition - col_indices.push_back(row_index - 2 * ntheta_int + 1); - } - } - - // alt: neumBC - if (j > 1 || (j == 1 && r[0] > 0)) { - // a l'interieur sans contact aux conditions aux limites - // if j > 1 // pas de reference vers l'origine ici - vals.push_back(gyro::art(r[j - 1], theta[i], 0) + gyro::art(r[j], thetap1, 0)); - index++; - } - } - } - - // (r,phi) - row_indices.push_back(row_index); - col_indices.push_back(row_index); - - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - if (j > 0) { - // alt: neumBound - - vals.push_back(0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * ktmin1 / hsmin1 * - (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0))); - } - else { //across the origin; j=0 - - vals.push_back(0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0))); - if (i + 1 > ntheta_int / 2) - vals[index] += - 0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)); - else // to make it symmetric, take values from second half circle - vals[index] += - 0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)); - } - - vals[index] += betaVec[row_index]; - index++; - } - } - - int size_ri = row_indices.size(); - int realsize_indices = 0; - for (int i = 0; i < size_ri; i++) - if (row_indices[i] > realsize_indices) - realsize_indices = row_indices[i]; - - // Dirichlet-RB (outside; last node in slice numbering) - double t_tmp = 0; - // gyro::trafo(r[nr_int], t_tmp, x, y, 0); - if (fabs(gyro::distBoundary(r[nr_int], t_tmp, 0)) < - tol_bound_check) { // dirBound([r(n+1),0])==0 means that (r(n+1),0) is on Dirichlet boundary - // if (bound_def_rad && r[nr_int] != Rmax) - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - // alt: r0=0 ? - double ri_end = row_indices[size_ri - 1]; - for (int i = 0; i < ntheta_int; i++) { - row_indices.push_back(ri_end + i + 1); - col_indices.push_back(ri_end + i + 1); // Matlab format.... - vals.push_back(1.0); - } - } -} /* ----- end of level::build_A0 ----- */ - -/*! - * \brief Build the RHS (deprecated) - * - * Builds the RHS of the system based on 9p FD. Relations with Dirichlet boundary - * condition nodes are shifted to the RHS to keep a symmetric operator. - * - */ -void level::build_rhs0() -{ - // Take boundary condition into account - - // created transformed vector from original right side - // zu -Laplace(u) = f to K(0,1) after transformed to polar coordinates, then - // right side for r in [eps, 1-eps]: r*f(r,phi) (values in loop below) - // D_scal_rhs = ones(global_size,1); % save h and k dependent scaling of the right side - // alt: r0=0/neumBound - int start_j; - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (gyro::icntl[Param::DirBC_Interior]) { - start_j = 1; - } - // dirBound([r(1),0])>0 means that (r(1),0) is not on Dirichlet boundary - else if (r[0] > 0 && !gyro::icntl[Param::DirBC_Interior]) { - start_j = 0; - } - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (gyro::icntl[Param::DirBC_Interior]) { - for (int i = 0; i < ntheta_int; i++) { - // Dirichlet-RB inside % one value for each point inside (Dirichlet-RB), i.e. ntheta_int-many - fVec.push_back(gyro::def_solution_rt(r[0], theta[i], 0)); - } - } - - // int i1 = 0, i2 = 0; - for (int j = start_j; j < nr_int; j++) { // nodes of Disk K(eps,1-eps) - for (int i = 0; i < ntheta_int; i++) { - // alt: r0=0 - int row_index = j * ntheta_int + i; - - // % ==================== % - double kt = thetaplus[i]; - double thetamin1, ktmin1, hs, hsmin1; - if (i > 0) { - thetamin1 = theta[i - 1]; - ktmin1 = thetaplus[i - 1]; - } - else { - thetamin1 = theta[ntheta_int - 1]; // equal to 2*PI-ktmin1 - ktmin1 = thetaplus[ntheta_int - 1]; - } - // % -------------------- % - // r(j+1) is the current r - hs = hplus[j]; - if (j > 0) - hsmin1 = hplus[j - 1]; - else - hsmin1 = 2 * r[0]; // across the origin - // % ==================== % - - // right side (r=r(j+1) because r(1)=0 or start of j at 0 if r(1)>0) - // fac_hk=1; %% Factor now in diagonal matrix - double fac_hk = 0.25 * (kt + ktmin1) * (hs + hsmin1); - fVec.push_back(fac_hk * fabs(gyro::detDFinv(r[j], theta[i], 0)) * - gyro::eval_def_rhs(r[j], theta[i], 0)); // right side for r\in(eps,1-eps): r*f(r,phi) - - // 9-Point Stencil (attention order; first bottom, then right, then top right, top left, bottom left, middle) - // r-h- (h- = x_i-x_i-1) - - // j=1 means r-h is on the boundary, dirBound([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) - // --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && gyro::icntl[Param::DirBC_Interior]) { - // conditions aux limites Dirichlet - fVec[row_index] += - (0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0))) * - gyro::def_solution_rt(r[j - 1], theta[i], 0); - } - - // (r-h-,phi-k) (en bas a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - // j=1 means r-h is on the boundary, dirBound([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) - // --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && gyro::icntl[Param::DirBC_Interior]) { - // conditions aux limites Dirichlet - fVec[row_index] += - (gyro::art(r[j], thetamin1, 0) + gyro::art(r[j - 1], theta[i], 0)) * - gyro::def_solution_rt(r[j - 1], thetamin1, - 0); // factor is positive on left hand side, so it is negative here... - } - } - - // phi-k - - // (r+h+,phi-k) (en haut a droite) - double theta_eval_prelast = 0; - if (gyro::icntl[Param::mod_pk] > 0) { - if (i <= 0) { - theta_eval_prelast = theta[ntheta_int - 1]; - } - - // j=nr_int-1 means r+h is on the boundary --> to symmetrize, put it on the right hand side - if (j == nr_int - 1) { - if (i > 0) { // not the first node on the corresponding circle; we can take theta(i-1) - fVec[row_index] -= (gyro::art(r[j], thetamin1, 0) + gyro::art(r[j + 1], theta[i], 0)) * - gyro::def_solution_rt(r[j + 1], theta[i - 1], 0); - } - else { - fVec[row_index] -= (gyro::art(r[j], thetamin1, 0) + gyro::art(r[j + 1], theta[i], 0)) * - gyro::def_solution_rt(r[j + 1], theta_eval_prelast, 0); - } - } - } - - // r + h+ (h+ = x_i+1-x_i) - // j=nr_int-1 means r+h is on the boundary --> to symmetrize, put it on the right hand side - if (j == nr_int - 1) { - fVec[row_index] += - (0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0))) * - gyro::def_solution_rt(r[j + 1], theta[i], 0); - } - - ////// INSERT HERE IN THE UPPER LEFT CORNER - // (r+h+,phi+k) (en haut a gauche) - - double thetap1 = 0; - if (gyro::icntl[Param::mod_pk] > 0) { - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - - // j=nr_int-1 means r+h is on the boundary --> to symmetrize, put it on the right hand side - if (j == nr_int - 1) { - fVec[row_index] += (gyro::art(r[j + 1], theta[i], 0) + gyro::art(r[j], thetap1, 0)) * - gyro::def_solution_rt(r[j + 1], thetap1, 0); - } - } - - // phi+k - double r_tmp, theta_tmp; - - // (r-h-,phi+k) (en bas a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - if (j == 1) { // coords necessary for potential boundary conditions - if (i + 1 < ntheta_int) { - // gyro::trafo(r[j - 1], theta[i + 1], x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = theta[i + 1]; - } - else { - double pi2 = 2 * PI; - // gyro::trafo(r[j - 1], pi2, x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = pi2; - } - } - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - // j=1 means r-h is on the boundary, gyro::distBoundary([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && gyro::icntl[Param::DirBC_Interior]) { - // conditions aux limites Dirichlet - // factor is positive on left hand side, so it is negative here... - fVec[row_index] -= (gyro::art(r[j - 1], theta[i], 0) + gyro::art(r[j], thetap1, 0)) * - gyro::def_solution_rt(r_tmp, theta_tmp, 0); - } - } - - // (r,phi) - } - } - - for (int i = 0; i < ntheta_int; i++) { - // Dirichlet-RB outside % one value for each point outside (Dirichlet-RB), i.e. ntheta-many, - fVec.push_back(gyro::def_solution_rt(r[nr_int], theta[i], 0)); - } -} /* ----- end of level::build_rhs0 ----- */ - -/*! - * \brief Applies the operator A without construction (deprecated) - * - * Applies the matrix A of the system based on 9p FD. Relations with Dirichlet - * boundary condition nodes are shifted to the RHS to keep a symmetric operator. - * - * everything expressed in polar coordinates - * allows anisotropy in r - * - r: array of discretized r values - * - ntheta: number of discretization intervals in angle phi (also variable m) - * - * solves the transformed DGL: r*u_rr + u_r + 1/r*u_phiphi = rf fuer r>0, r<=1, - * fuer r=0, approximate: u_0 = 1/m sum_j u(h,jk)-(h/2)^2*f - * sorting of nodes ringwise. first node origin, last ntheta - * Node all the way out - * - */ -void level::apply_A0(std::vector u, std::vector& Au) -{ - // if boundary is only defined on radius, checks for wrongly detected boundary - // nodes due to rounding errors (double checking...) - double tol_bound_check = gyro::dcntl[Param::tol_bound_check]; - - // double x, y; - int index; - - // Take boundary condition into account - // In the operator - // gyro::trafo(r[0], theta[0], x, y, 0); - // alt: r0=0/neumBound - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { - // Dirichlet-RB (intérieur ; premier noeud dans la numérotation des disques) - for (int i = 0; i < ntheta_int; i++) { - Au[i] += u[i]; - } - index = ntheta_int; - } - else { - index = 0; - } - - int row, col; - double v; - - // gyro::trafo(r[0], theta[0], x, y, 0); - // alt: r0=0/neumBound - int start_j = 0; - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { - // alt: neumBC - start_j = 1; - } - // dirBound([r(1),0])>0 means that (r(1),0) is not on Dirichlet boundary - else if (r[0] > 0 && fabs(gyro::distBoundary(r[0], theta[0], 0)) > tol_bound_check) { - // alt: neumBC - start_j = 0; - } - // int i1 = 0, i2 = 0; - for (int j = start_j; j < nr_int; j++) { // nodes of Disk K(eps,1-eps) - for (int i = 0; i < ntheta_int; i++) { - // alt: r0=0 - int row_index = j * ntheta_int + i; - - // % ==================== % - double kt = thetaplus[i]; - double thetamin1, ktmin1, hs, hsmin1; - if (i > 0) { - thetamin1 = theta[i - 1]; - ktmin1 = thetaplus[i - 1]; - } - else { - thetamin1 = theta[ntheta_int - 1]; // equal to 2*PI-ktmin1 - ktmin1 = thetaplus[ntheta_int - 1]; - } - // % -------------------- % - // r(j+1) is the current r - hs = hplus[j]; - if (j > 0) - hsmin1 = hplus[j - 1]; - else - hsmin1 = 2 * r[0]; // across the origin - // % ==================== % - - // 9-Point Stencil (attention order; first bottom, then right, then top right, top left, bottom left, middle) - // r-h- (h- = x_i-x_i-1) - // if (j == 1) - // gyro::trafo(r[j - 1], theta[i], x, y, 0); - // j=1 means r-h is on the boundary, dirBound([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) - // --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && fabs(gyro::distBoundary(r[j - 1], theta[i], 0)) < tol_bound_check) { - } - else { - // row_indices[index] = row_index; - row = row_index; - col = -42; - v = -42; - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) - if (j > 1 || (j == 1 && r[0] > 0)) { - // to u at r-h geometrically recorded (i.e. -ntheta_int nodes at slice sorting) - col = row_index - ntheta_int; - } - else { // j=0 or j=1 - if (r[0] == 0) { // all refering to the single origin node! (j=0 not possible in this case) - // Reference to u at r-h=0 geometrically recorded (for all i the origin, because here r=h) - col = 1; - } - else if (j == 0) { // across the origin - if (i + 1 > ntheta_int / 2) { - col = row_index - ntheta_int / 2; // half a turn back - } - else { - col = row_index + ntheta_int / 2; // half a turn further - } - } - } - - if (j > 0) { - // alt: neumBC - // a l interieur sans contact aux conditions aux limites - v = -0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)); - } - else { - // j==0; across the origin - // just use r_{s-1}=0 - if (i + 1 > ntheta_int / 2) - // Use r(0):=r(j) to go to the other side of the origin - v = -0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)); - else // to make it symmetric, take values from second half circle - v = -0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)); - } - Au[row] += v * u[col]; - index++; - } - // (r-h-,phi-k) (en bas a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - // if (j == 1) // coords necessary for potential boundary conditions - // gyro::trafo(r[j - 1], thetamin1, x, y, 0); // r(j) is PREVIOUS r, actual is r(J+1) ! - // j=1 means r-h is on the boundary, dirBound([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) - // --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && fabs(gyro::distBoundary(r[j - 1], thetamin1, 0)) < tol_bound_check) { - } - else { - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) - // but no dirichlet bc on innermost circle - if (j > 1 || (j == 1 && r[0] > 0)) { - row = row_index; - if (i > 0) // next node in theta direction but one circle before - col = row_index - ntheta_int - 1; - else // periodicity condition - col = row_index - 1; - } - - // if j > 0 - // alt: neumBound - if (j > 1 || (j == 1 && r[0] > 0)) { - // a l interieur sans contact aux conditions aux limites - // if (j > 1) // pas de reference vers l origine ici - v = -(gyro::art(r[j], thetamin1, 0) + gyro::art(r[j - 1], theta[i], 0)); - - Au[row] += v * u[col]; - index++; - } - } - } - - // phi-k - // row_indices[index] = row_index; - row = row_index; - if (i > 0) // previous node in phi direction - col = row_index - 1; - else // periodicity condition - col = row_index + ntheta_int - 1; - if (j > 0) - v = -0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) - - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - - else // j=0; take r(0)=0 // - v = -0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) - - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - - Au[row] += v * u[col]; - index++; - - // (r+h+,phi-k) (en haut a droite) - double theta_eval_prelast = 0; - double r_tmp, theta_tmp; - if (gyro::icntl[Param::mod_pk] > 0) { - if (i > 0) { // not the first node on the corresponding circle; we can take theta(i-1) - // gyro::trafo(r[j + 1], theta[i - 1], x, y, 0); - r_tmp = r[j + 1]; - theta_tmp = theta[i - 1]; - } - else { - theta_eval_prelast = theta[ntheta_int - 1]; - // gyro::trafo(r[j + 1], theta_eval_prelast, x, y, 0); - r_tmp = r[j + 1]; - theta_tmp = theta_eval_prelast; - } - - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1 || - (j == nr_int - 1 && fabs(gyro::distBoundary(r_tmp, theta_tmp, 0)) > tol_bound_check)) { - // row_indices[index] = row_index; - row = row_index; - if (i > 0) // previous node in phi direction but at r+h - col = row_index + ntheta_int - 1; - else // first node on corresponding circle; pay gyro::attention to periodicity condition! - col = row_index + 2 * ntheta_int - 1; - v = gyro::art(r[j], thetamin1, 0) + gyro::art(r[j + 1], theta[i], 0); - Au[row] += v * u[col]; - index++; - } - } - - // r + h+ (h+ = x_i+1-x_i) - // gyro::trafo(r[j + 1], theta[i], x, y, 0); - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1 || - (j == nr_int - 1 && fabs(gyro::distBoundary(r[j + 1], theta[i], 0)) > tol_bound_check)) { - row = row_index; - col = row_index + ntheta_int; // zu u bei r+h - v = -0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) - - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)); - Au[row] += v * u[col]; - index++; - } - // j=nr_int-1 means r+h is on the boundary --> to symmetrize, put it on the right hand side - else if (j == nr_int - 1 && fabs(gyro::distBoundary(r[j + 1], theta[i], 0)) < tol_bound_check) { - } - - // (r+h+,phi+k) (en haut a gauche) - double thetap1 = 0; - if (gyro::icntl[Param::mod_pk] > 0) { - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1 || - (j == nr_int - 1 && fabs(gyro::distBoundary(r[j + 1], theta[i], 0)) > tol_bound_check)) { - row = row_index; - if (i + 1 < ntheta_int) // previous node in phi direction but at r+h - col = row_index + ntheta_int + 1; - else // first node on corresponding circle; pay gyro::attention to periodicity condition! - col = row_index + 1; - v = -gyro::art(r[j + 1], theta[i], 0) - gyro::art(r[j], thetap1, 0); - - Au[row] += v * u[col]; - index++; - } - // j=nr_int-1 means r+h is on the boundary --> to symmetrize, put it on the right hand side - else if (j == nr_int - 1 && fabs(gyro::distBoundary(r[j + 1], theta[i], 0)) < tol_bound_check) { - // gyro::trafo(r[j + 1], thetap1, x, y, 0); - } - } - - // phi+k - // row_indices[index] = row_index; - row = row_index; - if (i + 1 < ntheta_int) // next node in theta direction - col = row_index + 1; - else // periodicity condition - col = row_index - ntheta_int + 1; - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - if (j > 0) - v = -0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) - - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)); - else // j=0; - v = -0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) - - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)); - - Au[row] += v * u[col]; - index++; - - // (r-h-,phi+k) (en bas a gauche) - if (gyro::icntl[Param::mod_pk] > 0) { - double theta_tmp; - if (j == 1) { // coords necessary for potential boundary conditions - if (i + 1 < ntheta_int) { - // gyro::trafo(r[j - 1], theta[i + 1], x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = theta[i + 1]; - } - else { - double pi2 = 2 * PI; - // gyro::trafo(r[j - 1], pi2, x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = pi2; - } - } - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - // j=1 means r-h is on the boundary, gyro::distBoundary([r(j),0])==0 means that that Dirichlet BC are set at (r(j),0)) --> to symmetrize, put it on the right hand side - if (j == 1 && r[j - 1] > 0 && fabs(gyro::distBoundary(r_tmp, theta_tmp, 0)) < tol_bound_check) { - } - else { - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) but no dirichlet bc on innermost circle - if (j > 1 || (j == 1 && r[0] > 0)) { - row = row_index; - if (i + 1 < ntheta_int) // next node in theta direction but one circle before - col = row_index - ntheta_int + 1; - else { // periodicity condition - col = row_index - 2 * ntheta_int + 1; - // theta_eval_prelast = theta[ntheta_int]; - } - } - - // alt: neumBC - if (j > 1 || (j == 1 && r[0] > 0)) { - // a l'interieur sans contact aux conditions aux limites - // if j > 1 // pas de reference vers l'origine ici - v = gyro::art(r[j - 1], theta[i], 0) + gyro::art(r[j], thetap1, 0); - Au[row] += v * u[col]; - index++; - } - } - } - - // (r,phi) - row = row_index; - col = row_index; - - if (i + 1 < ntheta_int) // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - else - thetap1 = 2 * PI; - if (j > 0) - // alt: neumBound - v = 0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - else { //across the origin; j=0 - v = 0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - if (i + 1 > ntheta_int / 2) - v += 0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)); - else // to make it symmetric, take values from second half circle - v += 0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)); - } - Au[row] += v * u[col]; - - double val = betaVec[row]; - Au[row] += val * u[col]; - index++; - } - } - - // Dirichlet-RB (outside; last node in slice numbering) - double t_tmp = 0; - // gyro::trafo(r[nr_int], t_tmp, x, y, 0); - if (fabs(gyro::distBoundary(r[nr_int], t_tmp, 0)) < - tol_bound_check) { // dirBound([r(n+1),0])==0 means that (r(n+1),0) is on Dirichlet boundary - // alt: r0=0 ? - for (int i = 0; i < ntheta_int; i++) { - Au[row + i + 1] += u[row + i + 1]; - } - } -} /* ----- end of level::apply_A0 ----- */ diff --git a/src/build_rhs_apply_op.cpp b/src/build_rhs_apply_op.cpp deleted file mode 100644 index 0dcb2bcb..00000000 --- a/src/build_rhs_apply_op.cpp +++ /dev/null @@ -1,2207 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file build_rhs_apply_op.cpp - * \brief Implementation of the 9p FD operators A and RHS - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "level.h" - -/*! - * \brief Build the operator A - * - * Builds the matrix A of the system based on 9p FD. Relations with Dirichlet - * boundary condition nodes are shifted to the RHS to keep a symmetric operator. - * - * everything expressed in polar coordinates - * allows anisotropy in r - * - r: array of discretized r values - * - ntheta: number of discretization intervals in angle phi (also variable m) - * - * solves the transformed DGL: r*u_rr + u_r + 1/r*u_phiphi = rf fuer r>0, r<=1, - * fuer r=0, approximate: u_0 = 1/m sum_j u(h,jk)-(h/2)^2*f - * sorting of nodes ringwise. first node origin, last ntheta - * Node all the way out - */ -void level::build_A() -{ - int start_j; - int* dep = new int[nr]; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! DB first line !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // Take boundary condition into account: Dirichlet-RB - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary - start_j = 1; - } - else { // (r[0],0) is not on Dirichlet boundary - start_j = 0; - } - -#pragma omp parallel shared(dep) - { -#pragma omp single - { - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary -#pragma omp task shared(dep, start_j) depend(out : dep[0]) - { - for (int i = 0; i < ntheta_int; i++) { - row_indices[i] = i; - col_indices[i] = i; - - vals[i] += 1.0; - } - } //end of task and parallel - } - -#pragma omp task shared(dep, start_j) depend(out : dep[nr_int]) - { - // int ptr, row; // To be removed ? - // Take boundary condition into account: Dirichlet-RB - for (int i = 0; i < ntheta_int; i++) { - // row = m - ntheta_int + i; - // ptr = nz - ntheta_int + i; - row_indices[nz - ntheta_int + i] = m - ntheta_int + i; - col_indices[nz - ntheta_int + i] = m - ntheta_int + i; - - vals[nz - ntheta_int + i] += 1.0; - } - } //end of task and parallel - -#pragma omp task shared(dep, start_j) depend(out : dep[start_j]) - { - int i, j, ptr, row, col; - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! First lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = start_j; - ptr_vect = get_ptr(j); - ptr_vect_next = get_ptr(j + 1); - stencil_cur = get_stencil(j); - stencil_next = get_stencil(j + 1); - stencil = stencil_cur; - - for (int i = 0; i < ntheta_int; i++) { - ptr = ptr_vect[i + 1]; - row = j * ntheta_int + i; - val = betaVec[row]; - - vals[ptr + stencil[Param::middle]] += val; - } - - hs = hplus[j]; - arr_vect = gyro::arr(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - // Across: bottom update - if (!gyro::icntl[Param::DirBC_Interior]) { - hsmin1 = 2 * r[0]; - // Accross the origin theta and arr - arr_vect2 = gyro::arr(r[j], theta_PI, sin_theta_PI, cos_theta_PI, ntheta_int, 0); - - for (i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect[i + 1]; - row = j * ntheta_int + i; - if (i + 1 <= ntheta_int / 2) // first half of circle: half a turn further - col = row + ntheta_int / 2; - else // second half of circle: half a turn back - col = row - ntheta_int / 2; - row_indices[ptr + stencil[Param::bottom]] = row; - col_indices[ptr + stencil[Param::bottom]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect2[i] / hsmin1; - coeff2 = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - - vals[ptr + stencil[Param::bottom]] += -coeff - coeff2; - - vals[ptr + stencil[Param::middle]] += coeff; - } - } - else { - hsmin1 = hplus[j - 1]; - // DB contribution arr (r(0)) - arr_vect2 = gyro::arr(r[j - 1], theta, sin_theta, cos_theta, ntheta_int, 0); - - for (i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect[i + 1]; - coeff = 0.5 * (kt + ktmin1) * arr_vect2[i] / hsmin1; - row = j * ntheta_int + i; - - vals[ptr + stencil[Param::middle]] += coeff; - } - } - - // Across and DB_int updates (~~~ Interior - (j-1, i)) - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - for (i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) (=== Interior - bottom) - ptr = ptr_vect[i + 1]; - stencil = stencil_cur; - row = j * ntheta_int + i; - row_indices[ptr + stencil[Param::middle]] = row; - col_indices[ptr + stencil[Param::middle]] = row; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - - vals[ptr + stencil[Param::top]] += -coeff / hs; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - - vals[ptr + stencil[Param::left]] += -coeff2 / ktmin1; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - - vals[ptr + stencil[Param::right]] += -coeff2 / kt; - - vals[ptr + stencil[Param::middle]] += coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Update (j, i+1) (=== Interior - bottom_left) - ptr = ptr_vect[i + 2]; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::left]] = row; - col_indices[ptr + stencil[Param::left]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - - vals[ptr + stencil[Param::left]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) (=== Interior - bottom_right) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::right]] = row; - col_indices[ptr + stencil[Param::right]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - - vals[ptr + stencil[Param::right]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j+1, i) (=== Interior) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom]] = row; - col_indices[ptr + stencil[Param::bottom]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - - vals[ptr + stencil[Param::bottom]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) (=== Interior - bottom_left) - ptr = ptr_vect[i + 2]; - stencil = stencil_cur; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - - // Update (j, i-1) (=== Interior - bottom_right) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j+1, i) (=== Interior) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - } - } // end of task - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Interior nodes (1) !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = start_j + 3; j < nr_int - 1; j += 3) { -#pragma omp task shared(dep, start_j) firstprivate(j) depend(out : dep[j]) - { - int ptr, row, col; - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - ptr_vect_prev = get_ptr(j - 1); - ptr_vect = get_ptr(j); - ptr_vect_next = get_ptr(j + 1); - stencil_prev = get_stencil(j - 1); - stencil_cur = get_stencil(j); - stencil_next = get_stencil(j + 1); - - stencil = stencil_cur; - for (int i = 0; i < ntheta_int; i++) { - ptr = ptr_vect[i + 1]; - row = j * ntheta_int + i; - val = betaVec[row]; - - vals[ptr + stencil[Param::middle]] += val; - } - - // - in r - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::top]] = row; - col_indices[ptr + stencil[Param::top]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - - vals[ptr + stencil[Param::top]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i) - ptr = ptr_vect[i + 1]; - stencil = stencil_cur; - row = j * ntheta_int + i; - row_indices[ptr + stencil[Param::middle]] = row; - col_indices[ptr + stencil[Param::middle]] = row; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - - vals[ptr + stencil[Param::top]] += -coeff / hs; - col = (j - 1) * ntheta_int + i; - - vals[ptr + stencil[Param::bottom]] += -coeff / hsmin1; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - - vals[ptr + stencil[Param::left]] += -coeff2 / ktmin1; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - - vals[ptr + stencil[Param::right]] += -coeff2 / kt; - - vals[ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Update (j, i+1) - ptr = ptr_vect[i + 2]; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::left]] = row; - col_indices[ptr + stencil[Param::left]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - - vals[ptr + stencil[Param::left]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::right]] = row; - col_indices[ptr + stencil[Param::right]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - - vals[ptr + stencil[Param::right]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j+1, i) (Not in DB_ext) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom]] = row; - col_indices[ptr + stencil[Param::bottom]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - - vals[ptr + stencil[Param::bottom]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j, i+1) - ptr = ptr_vect[i + 2]; - stencil = stencil_cur; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - - // Update (j, i-1) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j+1, i) (Not in DB_ext) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - } - } // end of task - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Interior nodes (2) !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = start_j + 1; j < nr_int - 1; j += 3) { -#pragma omp task shared(dep, start_j) firstprivate(j) depend(in \ - : dep[j - 1]) depend(in \ - : dep[j + 2]) depend(out \ - : dep[j]) - { - int ptr, row, col; - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - ptr_vect_prev = get_ptr(j - 1); - ptr_vect = get_ptr(j); - ptr_vect_next = get_ptr(j + 1); - stencil_prev = get_stencil(j - 1); - stencil_cur = get_stencil(j); - stencil_next = get_stencil(j + 1); - - stencil = stencil_cur; - for (int i = 0; i < ntheta_int; i++) { - ptr = ptr_vect[i + 1]; - row = j * ntheta_int + i; - val = betaVec[row]; - - vals[ptr + stencil[Param::middle]] += val; - } - - // - in r - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::top]] = row; - col_indices[ptr + stencil[Param::top]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - - vals[ptr + stencil[Param::top]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i) - ptr = ptr_vect[i + 1]; - stencil = stencil_cur; - row = j * ntheta_int + i; - row_indices[ptr + stencil[Param::middle]] = row; - col_indices[ptr + stencil[Param::middle]] = row; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - - vals[ptr + stencil[Param::top]] += -coeff / hs; - col = (j - 1) * ntheta_int + i; - - vals[ptr + stencil[Param::bottom]] += -coeff / hsmin1; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - - vals[ptr + stencil[Param::left]] += -coeff2 / ktmin1; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - - vals[ptr + stencil[Param::right]] += -coeff2 / kt; - - vals[ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Update (j, i+1) - ptr = ptr_vect[i + 2]; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::left]] = row; - col_indices[ptr + stencil[Param::left]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - - vals[ptr + stencil[Param::left]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::right]] = row; - col_indices[ptr + stencil[Param::right]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - - vals[ptr + stencil[Param::right]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j+1, i) (Not in DB_ext) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom]] = row; - col_indices[ptr + stencil[Param::bottom]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - - vals[ptr + stencil[Param::bottom]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j, i+1) - ptr = ptr_vect[i + 2]; - stencil = stencil_cur; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - - // Update (j, i-1) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j+1, i) (Not in DB_ext) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - } - } // end of task - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Interior nodes (3) !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = start_j + 2; j < nr_int - 1; j += 3) { -#pragma omp task shared(dep, start_j) firstprivate(j) depend(in \ - : dep[j - 1]) depend(in \ - : dep[j + 2]) depend(out \ - : dep[j]) - { - int ptr, row, col; - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - ptr_vect_prev = get_ptr(j - 1); - ptr_vect = get_ptr(j); - ptr_vect_next = get_ptr(j + 1); - stencil_prev = get_stencil(j - 1); - stencil_cur = get_stencil(j); - stencil_next = get_stencil(j + 1); - - stencil = stencil_cur; - for (int i = 0; i < ntheta_int; i++) { - ptr = ptr_vect[i + 1]; - row = j * ntheta_int + i; - val = betaVec[row]; - - vals[ptr + stencil[Param::middle]] += val; - } - - // - in r - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::top]] = row; - col_indices[ptr + stencil[Param::top]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - - vals[ptr + stencil[Param::top]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i) - ptr = ptr_vect[i + 1]; - stencil = stencil_cur; - row = j * ntheta_int + i; - row_indices[ptr + stencil[Param::middle]] = row; - col_indices[ptr + stencil[Param::middle]] = row; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - - vals[ptr + stencil[Param::top]] += -coeff / hs; - col = (j - 1) * ntheta_int + i; - - vals[ptr + stencil[Param::bottom]] += -coeff / hsmin1; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - - vals[ptr + stencil[Param::left]] += -coeff2 / ktmin1; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - - vals[ptr + stencil[Param::right]] += -coeff2 / kt; - - vals[ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Update (j, i+1) - ptr = ptr_vect[i + 2]; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::left]] = row; - col_indices[ptr + stencil[Param::left]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - - vals[ptr + stencil[Param::left]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::right]] = row; - col_indices[ptr + stencil[Param::right]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - - vals[ptr + stencil[Param::right]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j+1, i) (Not in DB_ext) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom]] = row; - col_indices[ptr + stencil[Param::bottom]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - - vals[ptr + stencil[Param::bottom]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j, i+1) - ptr = ptr_vect[i + 2]; - stencil = stencil_cur; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - - // Update (j, i-1) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - col = (j + 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j+1, i) (Not in DB_ext) - ptr = ptr_vect_next[i + 1]; - stencil = stencil_next; - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - } - } // end of task - } - -#pragma omp task shared(dep, start_j) depend(in \ - : dep[nr_int - 2]) depend(in \ - : dep[nr_int - 3]) depend(out \ - : dep[nr_int - 1]) - { - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - int j, ptr, row, col; - double coeff, coeff2, val, coeff3, kt, ktmin1, hs, hsmin1; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - j = nr_int - 1; - ptr_vect_prev = get_ptr(j - 1); - ptr_vect = get_ptr(j); - stencil_prev = get_stencil(j - 1); - stencil_cur = get_stencil(j); - - stencil = stencil_cur; - for (int i = 0; i < ntheta_int; i++) { - ptr = ptr_vect[i + 1]; - row = j * ntheta_int + i; - val = betaVec[row]; - - vals[ptr + stencil[Param::middle]] += val; - } - - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - arr_vect2 = gyro::arr(r[j + 1], theta, sin_theta, cos_theta, ntheta_int, 0); - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (=== Interior) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::top]] = row; - col_indices[ptr + stencil[Param::top]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - - vals[ptr + stencil[Param::top]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i) (=== Interior - top) - ptr = ptr_vect[i + 1]; - stencil = stencil_cur; - row = j * ntheta_int + i; - col = row; - row_indices[ptr + stencil[Param::middle]] = row; - col_indices[ptr + stencil[Param::middle]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j - 1) * ntheta_int + i; - - vals[ptr + stencil[Param::bottom]] += -coeff / hsmin1; - - // Contribution to middle (top) from DB - coeff2 = 0.5 * (kt + ktmin1) * arr_vect2[i] / hs; - - coeff3 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - - vals[ptr + stencil[Param::left]] += -coeff3 / ktmin1; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - - vals[ptr + stencil[Param::right]] += -coeff3 / kt; - - vals[ptr + stencil[Param::middle]] += - coeff / hsmin1 + coeff / hs + coeff2 + coeff3 / ktmin1 + coeff3 / kt; - - // Update (j, i+1) (=== Interior - top_left) - ptr = ptr_vect[i + 2]; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::left]] = row; - col_indices[ptr + stencil[Param::left]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - - vals[ptr + stencil[Param::left]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) (=== Interior - top_right) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - row_indices[ptr + stencil[Param::right]] = row; - col_indices[ptr + stencil[Param::right]] = col; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - - vals[ptr + stencil[Param::right]] += -coeff; - - vals[ptr + stencil[Param::middle]] += coeff; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (=== Interior) - ptr = ptr_vect_prev[i + 1]; - stencil = stencil_prev; - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - row_indices[ptr + stencil[Param::top_left]] = row; - col_indices[ptr + stencil[Param::top_left]] = col; - - vals[ptr + stencil[Param::top_left]] += art_vect[i]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - row_indices[ptr + stencil[Param::top_right]] = row; - col_indices[ptr + stencil[Param::top_right]] = col; - - vals[ptr + stencil[Param::top_right]] += -art_vect[i]; - - // Update (j, i+1) (=== Interior - top_left) - ptr = ptr_vect[i + 2]; - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_left]] = row; - col_indices[ptr + stencil[Param::bottom_left]] = col; - - vals[ptr + stencil[Param::bottom_left]] += -art_vect[i]; - - // Update (j, i-1) (=== Interior - top_right) - ptr = ptr_vect[i]; - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - row_indices[ptr + stencil[Param::bottom_right]] = row; - col_indices[ptr + stencil[Param::bottom_right]] = col; - - vals[ptr + stencil[Param::bottom_right]] += art_vect[i]; - } - } //end of task - } //end of single - } //end of parallel - - delete[] dep; -} /* ----- end of level::build_A ----- */ - -/*! - * \brief Build the RHS - * - * Builds the RHS of the system based on 9p FD. Relations with Dirichlet boundary - * condition nodes are shifted to the RHS to keep a symmetric operator. - * - */ -void level::build_rhs() -{ - // double tol_bound_check = 1e-8; - // double Rmax = gyro::dcntl[Param::R]; - int start_j; - int* dep = new int[nr]; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! DB first line !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // Take boundary condition into account: Dirichlet-RB - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary - start_j = 1; - } - else // (r[0],0) is not on Dirichlet boundary - start_j = 0; - -#pragma omp parallel shared(dep) - { -#pragma omp single - { - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary -#pragma omp task shared(dep, start_j) depend(out : dep[0]) - { - std::vector sol = gyro::def_solution_rt(r[0], theta, sin_theta, cos_theta, ntheta_int, 0); - for (int i = 0; i < ntheta_int; i++) { - - fVec[i] = sol[i]; - } - } //end of task - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Fill base RHS !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // across the origin (treat separately because of hsmin1) - // std::vector coeff_b = gyro::coeff_beta(r, 0); - for (int j = start_j; j < nr_int; j++) { -#pragma omp task shared(dep, start_j) firstprivate(j) depend(out : dep[j]) - { - int i, row; - double kt, ktmin1, hs, hsmin1; - if (j == 0) - hsmin1 = 2 * r[0]; - else - hsmin1 = hplus[j - 1]; - std::vector det = gyro::detDFinv(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - std::vector rhs = gyro::eval_def_rhs(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - // Define the index, position and interval size of current and previous node - // - in r - hs = hplus[j]; - for (i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - double fac_hk = 0.25 * (kt + ktmin1) * (hs + hsmin1); - - fVec[row] = fac_hk * fabs(det[i]) * rhs[i]; - } - hsmin1 = hs; - } - } //end of task - -/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! DB_int !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ -#pragma omp task shared(dep, start_j) depend(in : dep[1]) - { - // int hs, ; - int j = 1; - if (gyro::icntl[Param::DirBC_Interior]) { - int i, row; - double kt, ktmin1; - std::vector sol = - gyro::def_solution_rt(r[j - 1], theta, sin_theta, cos_theta, ntheta_int, 0); - if (gyro::icntl[Param::mod_pk] > 0) { - std::vector art_vect_prev = - gyro::art(r[j - 1], theta_per, sin_theta_per, cos_theta_per, ntheta_int + 1, 0); - std::vector art_vect = - gyro::art(r[j], theta_per, sin_theta_per, cos_theta_per, ntheta_int + 1, 0); - for (i = 1; i < ntheta_int - 1; i++) { - row = j * ntheta_int + i; - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // bottom_left - fVec[row] += (art_vect[i] + art_vect_prev[i + 1]) * sol[i - 1]; - // bottom_right - fVec[row] -= (art_vect_prev[i + 1] + art_vect[i + 2]) * sol[i + 1]; - } - // i=0 - i = 0; - row = j * ntheta_int + i; - - fVec[row] += (art_vect[ntheta_int] + art_vect_prev[1]) * sol[ntheta_int - 1]; - - fVec[row] -= (art_vect_prev[1] + art_vect[2]) * sol[1]; - - // i=ntheta_int-1 - i = ntheta_int - 1; - row = j * ntheta_int + i; - - fVec[row] += (art_vect[ntheta_int - 1] + art_vect_prev[ntheta_int]) * sol[ntheta_int - 2]; - - fVec[row] -= (art_vect_prev[ntheta_int] + art_vect[1]) * sol[0]; - } - std::vector arr_vect_prev = gyro::arr(r[j - 1], theta, sin_theta, cos_theta, ntheta_int, 0); - std::vector arr_vect = gyro::arr(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - for (i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - // - in r - double hsmin1 = hplus[j - 1]; - - // bottom - - fVec[row] += 0.5 * (kt + ktmin1) * (arr_vect_prev[i] + arr_vect[i]) * sol[i] / hsmin1; - } - } - } //end of task - -/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! DB_ext !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ -#pragma omp task shared(dep, start_j) depend(in : dep[nr_int - 1]) - { - int i, j, row; - double kt, ktmin1, hs; - // double hsmin1; - j = nr_int - 1; - std::vector sol = gyro::def_solution_rt(r[j + 1], theta, sin_theta, cos_theta, ntheta_int, 0); - if (gyro::icntl[Param::mod_pk] > 0) { - std::vector art_vect = - gyro::art(r[j], theta_per, sin_theta_per, cos_theta_per, ntheta_int + 1, 0); - std::vector art_vect_next = - gyro::art(r[j + 1], theta_per, sin_theta_per, cos_theta_per, ntheta_int + 1, 0); - for (i = 1; i < ntheta_int - 1; i++) { - row = j * ntheta_int + i; - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - // - in r - hs = hplus[j]; - - // top_left - - fVec[row] -= (art_vect[i] + art_vect_next[i + 1]) * sol[i - 1]; - // top_right - - fVec[row] += (art_vect_next[i + 1] + art_vect[i + 2]) * sol[i + 1]; - } - // i=0 - i = 0; - row = j * ntheta_int + i; - - fVec[row] -= (art_vect[ntheta_int] + art_vect_next[1]) * sol[ntheta_int - 1]; - - fVec[row] += (art_vect_next[1] + art_vect[2]) * sol[1]; - - // i=ntheta_int-1 - i = ntheta_int - 1; - row = j * ntheta_int + i; - - fVec[row] -= (art_vect[ntheta_int - 1] + art_vect_next[ntheta_int]) * sol[ntheta_int - 2]; - - fVec[row] += (art_vect_next[ntheta_int] + art_vect[1]) * sol[0]; - } - std::vector arr_vect = gyro::arr(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - std::vector arr_vect_next = gyro::arr(r[j + 1], theta, sin_theta, cos_theta, ntheta_int, 0); - for (i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - // - in r - hs = hplus[j]; - - // top - - fVec[row] += (0.5 * (kt + ktmin1) * (arr_vect[i] + arr_vect_next[i])) * sol[i] / hs; - } - } //end of task - -/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! DB last line !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ -#pragma omp task shared(dep, start_j) depend(out : dep[nr_int]) - { - std::vector sol = gyro::def_solution_rt(r[nr_int], theta, sin_theta, cos_theta, ntheta_int, 0); - for (int i = 0; i < ntheta_int; i++) { - - fVec[m - ntheta_int + i] = sol[i]; - } - } - } //end of single - } //end of parallel - - delete[] dep; -} /* ----- end of level::build_rhs ----- */ - -/*! - * \brief Build the RHS - * - * Builds the RHS of the system based on 9p FD. Relations with Dirichlet boundary - * condition nodes are shifted to the RHS to keep a symmetric operator. - * - */ -void level::build_betaVec() -{ - // #pragma omp parallel shared(dep) - { - // #pragma omp single - { - // across the origin (treat separately because of hsmin1) - for (int j = 0; j < nr_int; j++) { - // #pragma omp task shared(dep, start_j) firstprivate(j) depend(out : dep[j]) - { - int i, row; - double kt, ktmin1, hs, hsmin1; - if (j == 0) - hsmin1 = 2 * r[0]; - else - hsmin1 = hplus[j - 1]; - std::vector det = gyro::detDFinv(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - // Define the index, position and interval size of current and previous node - // - in r - hs = hplus[j]; - for (i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - double coeff_b = gyro::coeff_beta(r[j], 0); - - double fac_hk = 0.25 * (kt + ktmin1) * (hs + hsmin1); - betaVec[row] = fac_hk * coeff_b * fabs(det[i]); - } - hsmin1 = hs; - } - } //end of task - } //end of single - } //end of parallel -} /* ----- end of level::build_betaVec ----- */ - -/*! - * \brief Applies the operator A without construction - * - * Applies the matrix A of the system based on 9p FD. Relations with Dirichlet - * boundary condition nodes are shifted to the RHS to keep a symmetric operator. - * - * everything expressed in polar coordinates - * allows anisotropy in r - * - r: array of discretized r values - * - ntheta: number of discretization intervals in angle phi (also variable m) - * - * solves the transformed DGL: r*u_rr + u_r + 1/r*u_phiphi = rf fuer r>0, r<=1, - * fuer r=0, approximate: u_0 = 1/m sum_j u(h,jk)-(h/2)^2*f - * sorting of nodes ringwise. first node origin, last ntheta - * Node all the way out - * - * \param u: vector on which to apply A - * \param Au: result vector = A*u - * - */ -void level::apply_A(std::vector u, std::vector& Au) -{ - int start_j; - int* dep = new int[nr]; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! DB first line !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // Take boundary condition into account: Dirichlet-RB - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary - start_j = 1; - } - else { // (r[0],0) is not on Dirichlet boundary - start_j = 0; - } - -#pragma omp parallel shared(dep, Au) - { -#pragma omp single - { - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary -#pragma omp task depend(out : dep[0]) - { - for (int i = 0; i < ntheta_int; i++) { - - Au[i] += u[i]; - } - } //end of task - } - -#pragma omp task depend(out : dep[nr_int]) - { - // Take boundary condition into account: Dirichlet-RB - for (int i = 0; i < ntheta_int; i++) { - int row = m - ntheta_int + i; - - Au[row] += u[row]; - } - } //end of task and parallel - -#pragma omp task depend(out : dep[start_j]) - { - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - int row, col; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! First lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - int j = start_j; - - for (int i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - val = betaVec[row]; - - Au[row] += val * u[row]; - } - - hs = hplus[j]; - arr_vect = gyro::arr(r[j], theta, sin_theta, cos_theta, ntheta_int, 0); - // Across: bottom update - if (!gyro::icntl[Param::DirBC_Interior]) { - hsmin1 = 2 * r[0]; - // Accross the origin theta and arr - arr_vect2 = gyro::arr(r[j], theta_PI, sin_theta_PI, cos_theta_PI, ntheta_int, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - row = j * ntheta_int + i; - if (i + 1 <= ntheta_int / 2) // first half of circle: half a turn further - col = row + ntheta_int / 2; - else // second half of circle: half a turn back - col = row - ntheta_int / 2; - - coeff = 0.5 * (kt + ktmin1) * arr_vect2[i] / hsmin1; - coeff2 = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - // bottom - val = -coeff - coeff2; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - } - else { - hsmin1 = hplus[j - 1]; - // DB contribution arr (r(0)) - arr_vect2 = gyro::arr(r[j - 1], theta, sin_theta, cos_theta, ntheta_int, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - coeff = 0.5 * (kt + ktmin1) * arr_vect2[i] / hsmin1; - row = j * ntheta_int + i; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - } - - // Across and DB_int updates (~~~ Interior - (j-1, i)) - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) (=== Interior - bottom) - row = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - // top - val = -coeff / hs; - - Au[row] += val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // left - val = -coeff2 / ktmin1; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // right - val = -coeff2 / kt; - - Au[row] += val * u[col]; - - // middle - val = coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - Au[row] += val * u[row]; - - // Update (j, i+1) (=== Interior - bottom_left) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - // left - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i-1) (=== Interior - bottom_right) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - // right - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j+1, i) (=== Interior) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - // bottom - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - - if (gyro::icntl[Param::mod_pk] > 0) { - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) (=== Interior - bottom_left) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j + 1) * ntheta_int + i; - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i-1) (=== Interior - bottom_right) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j + 1) * ntheta_int + i; - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j+1, i) (=== Interior) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - } - } - } // end of task -------------------------------------------------------------------------------------------------- - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Interior nodes (1) !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = start_j + 3; j < nr_int - 1; j += 3) { -#pragma omp task firstprivate(j) depend(out : dep[j]) - { - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - int row, col; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - for (int i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - val = betaVec[row]; - - Au[row] += val * u[row]; - } - - // - in r - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - // top - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i) - row = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - // top - val = -coeff / hs; - - Au[row] += val * u[col]; - col = (j - 1) * ntheta_int + i; - // bottom - val = -coeff / hsmin1; - - Au[row] += val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // left - val = -coeff2 / ktmin1; - Au[row] += val * u[col]; - - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // right - val = -coeff2 / kt; - - Au[row] += val * u[col]; - - // middle - val = coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - Au[row] += val * u[row]; - - // Update (j, i+1) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - // left - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i-1) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - // right - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j+1, i) (Not in DB_ext) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - // bottom - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - if (gyro::icntl[Param::mod_pk] > 0) { - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i+1) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = (j + 1) * ntheta_int + i; - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i-1) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - col = (j + 1) * ntheta_int + i; - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j+1, i) (Not in DB_ext) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - } - } - } // end of task ----------------------------------------------------------------------------------------------- - } //end of for - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Interior nodes (2) !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = start_j + 1; j < nr_int - 1; j += 3) { -#pragma omp task firstprivate(j) depend(in : dep[j - 1]) depend(in : dep[j + 2]) depend(out : dep[j]) - { - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - int row, col; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - for (int i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - val = betaVec[row]; - - Au[row] += val * u[row]; - } - - // - in r - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - // top - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i) - row = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - // top - val = -coeff / hs; - - Au[row] += val * u[col]; - col = (j - 1) * ntheta_int + i; - // bottom - val = -coeff / hsmin1; - - Au[row] += val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // left - val = -coeff2 / ktmin1; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // right - val = -coeff2 / kt; - - Au[row] += val * u[col]; - - // middle - val = coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - Au[row] += val * u[row]; - - // Update (j, i+1) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - // left - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i-1) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - // right - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j+1, i) (Not in DB_ext) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - // bottom - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - if (gyro::icntl[Param::mod_pk] > 0) { - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i+1) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = (j + 1) * ntheta_int + i; - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i-1) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - col = (j + 1) * ntheta_int + i; - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j+1, i) (Not in DB_ext) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - } - } - } // end of task ------------------------------------------------------------------------------------------- - } //end of for - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Interior nodes (2) !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = start_j + 2; j < nr_int - 1; j += 3) { -#pragma omp task depend(in : dep[j - 1]) depend(in : dep[j + 2]) depend(out : dep[j]) - { - double coeff, coeff2, val, kt, ktmin1, hs, hsmin1; - int row, col; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - for (int i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - val = betaVec[row]; - - Au[row] += val * u[row]; - } - - // - in r - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - // top - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i) - row = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - // top - val = -coeff / hs; - - Au[row] += val * u[col]; - col = (j - 1) * ntheta_int + i; - // bottom - val = -coeff / hsmin1; - - Au[row] += val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // left - val = -coeff2 / ktmin1; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // right - val = -coeff2 / kt; - - Au[row] += val * u[col]; - - // middle - val = coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - Au[row] += val * u[row]; - - // Update (j, i+1) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - // left - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i-1) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - // right - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j+1, i) (Not in DB_ext) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - // bottom - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - if (gyro::icntl[Param::mod_pk] > 0) { - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (Not in DB_int) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i+1) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = (j + 1) * ntheta_int + i; - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i-1) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - col = (j + 1) * ntheta_int + i; - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j+1, i) (Not in DB_ext) - row = (j + 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - } - } - } // end of task ------------------------------------------------------------------------------------------- - } //end of for - -#pragma omp task depend(in : dep[nr_int - 2]) depend(in : dep[nr_int - 3]) depend(out : dep[nr_int - 1]) - { - double coeff, coeff2, coeff3, val, kt, ktmin1, hs, hsmin1; - int row, col; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines (1) !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - int j = nr_int - 1; - for (int i = 0; i < ntheta_int; i++) { - row = j * ntheta_int + i; - val = betaVec[row]; - - Au[row] += val * u[row]; - } - - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - arr_vect2 = gyro::arr(r[j + 1], theta, sin_theta, cos_theta, ntheta_int, 0); - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (=== Interior) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - // top - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i) (=== Interior - top) - row = j * ntheta_int + i; - col = row; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j - 1) * ntheta_int + i; - // bottom - val = -coeff / hsmin1; - - Au[row] += val * u[col]; - - // Contribution to middle (top) from DB - coeff2 = 0.5 * (kt + ktmin1) * arr_vect2[i] / hs; - - coeff3 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // left - val = -coeff3 / ktmin1; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // right - val = -coeff3 / kt; - - Au[row] += val * u[col]; - - // middle - val = coeff / hsmin1 + coeff / hs + coeff2 + coeff3 / ktmin1 + coeff3 / kt; - - Au[row] += val * u[row]; - - // Update (j, i+1) (=== Interior - top_left) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - // left - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - - // Update (j, i-1) (=== Interior - top_right) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = j * ntheta_int + i; - - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - // right - val = -coeff; - - Au[row] += val * u[col]; - // middle - val = coeff; - - Au[row] += val * u[row]; - } - if (gyro::icntl[Param::mod_pk] > 0) { - for (int i = 0; i < ntheta_int; i++) { - // Define the index, position and interval size of current and previous node - // - in theta - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) (=== Interior) - row = (j - 1) * ntheta_int + i; - col = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - // top_left - val = art_vect[i]; - - Au[row] += val * u[col]; - col = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - // top_right - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i+1) (=== Interior - top_left) - row = j * ntheta_int + ((i + 1 > ntheta_int - 1) ? 0 : i + 1); - col = (j - 1) * ntheta_int + i; - // bottom_left - val = -art_vect[i]; - - Au[row] += val * u[col]; - - // Update (j, i-1) (=== Interior - top_right) - row = j * ntheta_int + ((i - 1 < 0) ? ntheta_int - 1 : i - 1); - col = (j - 1) * ntheta_int + i; - // bottom_right - val = art_vect[i]; - - Au[row] += val * u[col]; - } - } - } //end of task - } //end of single - } //end of parallel - - delete[] dep; -} /* ----- end of level::apply_A ----- */ diff --git a/src/convergence_order.cpp b/src/convergence_order.cpp new file mode 100644 index 00000000..d1061b0a --- /dev/null +++ b/src/convergence_order.cpp @@ -0,0 +1,211 @@ +#include +#include +#include +#include +#include +#include + +#include "../include/GMGPolar/gmgpolar.h" +#include "../include/GMGPolar/test_cases.h" + +int main(int argc, char* argv[]) +{ +#ifdef NDEBUG + std::cout << "Build Type: Release\n" << std::endl; +#else + std::cout << "Build Type: Debug\n" << std::endl; +#endif + + const double R0 = 1e-8; + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; + + /* Example 1: Polar Solution -> Higher Order 4.0 */ + const double alpha_jump = 0.4837 * Rmax; + std::unique_ptr domain_geometry = + std::make_unique(Rmax, elongation_kappa, shift_delta); + std::unique_ptr exact_solution = + std::make_unique(Rmax, elongation_kappa, shift_delta); + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, elongation_kappa, shift_delta); + std::unique_ptr source_term = + std::make_unique(Rmax, elongation_kappa, shift_delta); + + /* Example 2: Cartesian Solution -> Lower Order 3.5 */ + // const double alpha_jump = 0.66 * Rmax; + // std::unique_ptr domain_geometry = std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // std::unique_ptr exact_solution = std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + // std::unique_ptr boundary_conditions = std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + // std::unique_ptr source_term = std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + + /* Example 3: Refined Solution -> Lower Order 3.5 */ + // const double alpha_jump = 0.9 * Rmax; // Refinement where the solution is most complex + // std::unique_ptr domain_geometry = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr exact_solution = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + // std::unique_ptr boundary_conditions = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr source_term = std::make_unique(Rmax, elongation_kappa, shift_delta); + + GMGPolar solver(std::move(domain_geometry), std::move(coefficients), std::move(boundary_conditions), + std::move(source_term)); + + solver.setSolution(std::move(exact_solution)); + + const int verbose = 0; + const bool paraview = false; + + const int maxOpenMPThreads = 16; + const double threadReductionFactor = 1.0; + + const StencilDistributionMethod stencilDistributionMethod = StencilDistributionMethod::CPU_GIVE; + const bool cacheDensityProfileCoefficients = true; + const bool cacheDomainGeometry = false; + + const int nr_exp = 4; + const int ntheta_exp = 6; + const int anisotropic_factor = 3; + int divideBy2 = 0; + const int MAX_DIVIDE_BY_2 = 6; + + const bool DirBC_Interior = false; + + const bool FMG = true; + const int FMG_iterations = 3; + const MultigridCycleType FMG_cycle = MultigridCycleType::F_CYCLE; + + const ExtrapolationType extrapolation = ExtrapolationType::IMPLICIT_EXTRAPOLATION; + const int maxLevels = 6; + const int preSmoothingSteps = 1; + const int postSmoothingSteps = 1; + const MultigridCycleType multigridCycle = MultigridCycleType::F_CYCLE; + + const int maxIterations = 150; + const ResidualNormType residualNormType = ResidualNormType::EUCLIDEAN; + const double absoluteTolerance = 1e-10; + const double relativeTolerance = 1e-8; + + solver.verbose(verbose); + solver.paraview(paraview); + + solver.maxOpenMPThreads(maxOpenMPThreads); + solver.threadReductionFactor(threadReductionFactor); + + solver.stencilDistributionMethod(stencilDistributionMethod); + solver.cacheDensityProfileCoefficients(cacheDensityProfileCoefficients); + solver.cacheDomainGeometry(cacheDomainGeometry); + + solver.R0(R0); + solver.Rmax(Rmax); + solver.nr_exp(nr_exp); + solver.ntheta_exp(ntheta_exp); + solver.anisotropic_factor(anisotropic_factor); + solver.divideBy2(divideBy2); + + solver.DirBC_Interior(DirBC_Interior); + + solver.FMG(FMG); + solver.FMG_iterations(FMG_iterations); + solver.FMG_cycle(FMG_cycle); + + solver.extrapolation(extrapolation); + solver.maxLevels(maxLevels); + solver.preSmoothingSteps(preSmoothingSteps); + solver.postSmoothingSteps(postSmoothingSteps); + solver.multigridCycle(multigridCycle); + + solver.maxIterations(maxIterations); + solver.residualNormType(residualNormType); + solver.absoluteTolerance(absoluteTolerance); + solver.relativeTolerance(relativeTolerance); + + std::vector table_nr(MAX_DIVIDE_BY_2); + std::vector table_ntheta(MAX_DIVIDE_BY_2); + std::vector table_dofs(MAX_DIVIDE_BY_2); + std::vector table_iterations(MAX_DIVIDE_BY_2); + std::vector table_reduction_factor(MAX_DIVIDE_BY_2); + std::vector table_exact_error_weighted_euclidean(MAX_DIVIDE_BY_2); + std::vector table_exact_error_weighted_euclidean_order(MAX_DIVIDE_BY_2); + std::vector table_exact_error_infinity(MAX_DIVIDE_BY_2); + std::vector table_exact_error_infinity_order(MAX_DIVIDE_BY_2); + std::vector table_total_time(MAX_DIVIDE_BY_2); + + for (divideBy2 = 0; divideBy2 < MAX_DIVIDE_BY_2; divideBy2++) { + solver.divideBy2(divideBy2); + + solver.setup(); + solver.solve(); + + table_nr[divideBy2] = solver.grid().nr(); + table_ntheta[divideBy2] = solver.grid().ntheta(); + table_dofs[divideBy2] = solver.grid().numberOfNodes(); + table_iterations[divideBy2] = solver.numberOfIterations(); + table_reduction_factor[divideBy2] = solver.meanResidualReductionFactor(); + table_exact_error_weighted_euclidean[divideBy2] = solver.exactErrorWeightedEuclidean().value(); + table_exact_error_infinity[divideBy2] = solver.exactErrorInfinity().value(); + table_total_time[divideBy2] = solver.t_setup_total + solver.t_solve_total; + } + + table_exact_error_weighted_euclidean_order[0] = std::numeric_limits::max(); + + table_exact_error_infinity_order[0] = std::numeric_limits::max(); + + for (int i = 1; i < MAX_DIVIDE_BY_2; i++) { + table_exact_error_weighted_euclidean_order[i] = + log(table_exact_error_weighted_euclidean[i - 1] / table_exact_error_weighted_euclidean[i]) / + log(sqrt(static_cast(table_dofs[i]) / static_cast(table_dofs[i - 1]))); + + table_exact_error_infinity_order[i] = + log(table_exact_error_infinity[i - 1] / table_exact_error_infinity[i]) / + log(sqrt(static_cast(table_dofs[i]) / static_cast(table_dofs[i - 1]))); + } + + // Set up table formatting + std::cout << std::fixed << std::setprecision(2); + + // Print the header + std::cout << std::setw(12) << "nr x nθ" << std::setw(9) << "its" << std::setw(7) << "ρ" << std::setw(25) + << "||err||_2/sqrt(m)" << std::setw(6) << "ord" << std::setw(22) << "||err||_∞" << std::setw(6) << "ord" + << std::setw(15) << "time[s]" << std::endl; + + // Print the table rows with data + for (int i = 0; i < MAX_DIVIDE_BY_2; i++) { + // Start the row + std::cout << std::setw(6) << table_nr[i] << " x " << table_ntheta[i] << std::setw(7.5) << table_iterations[i] + << std::setw(9) << table_reduction_factor[i]; + + // Print ||err||_2/sqrt(m) in scientific notation + std::cout << std::scientific << std::setprecision(2); + std::cout << std::setw(20) << table_exact_error_weighted_euclidean[i]; + + // Print ord for ||err||_2/sqrt(m) + std::cout << std::fixed << std::setprecision(2); // Go back to fixed notation + std::cout << std::setw(10); + if (table_exact_error_weighted_euclidean_order[i] != std::numeric_limits::max()) + std::cout << table_exact_error_weighted_euclidean_order[i]; + else + std::cout << "-"; + + // Print ||err||_∞ in scientific notation + std::cout << std::scientific << std::setprecision(2); + std::cout << std::setw(18) << table_exact_error_infinity[i]; + + // Print ord for ||err||_∞ + std::cout << std::fixed << std::setprecision(2); // Back to fixed + std::cout << std::setw(8); + if (table_exact_error_infinity_order[i] != std::numeric_limits::max()) + std::cout << table_exact_error_infinity_order[i]; + else + std::cout << "-"; + + // Print time[s] + std::cout << std::setw(12) << table_total_time[i] << std::endl; + } + std::cout << "\n"; + + return 0; +} diff --git a/src/create_grid_polar.cpp b/src/create_grid_polar.cpp deleted file mode 100644 index 7c7cb5ec..00000000 --- a/src/create_grid_polar.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file create_grid_polar.cpp - * \brief Implementation of the creation of the polar grid (r and theta) - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gmgpolar.h" -#include "level.h" - -/*! - * \brief Create the polar grids - * - * Create the polar finest grids - * - */ -void gmgpolar::create_grid_polar() -{ - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Creating polar grid...\n"; - - level* new_level = new level(0); - v_level.push_back(new_level); - if (gyro::f_grid_r.empty() || gyro::icntl[Param::write_radii_angles] == 1) { - v_level[0]->build_r(); - } - else { - v_level[0]->read_grid_r(); - } - if (gyro::f_grid_theta.empty() || gyro::icntl[Param::write_radii_angles] == 1) { - v_level[0]->build_theta(); - } - else { - v_level[0]->read_grid_theta(); - } - - if (v_level[0]->ntheta < 2) - throw std::runtime_error("Choose size theta > 3!"); - - gyro::dcntl[Param::R0] = v_level[0]->r[0]; - gyro::dcntl[Param::R] = v_level[0]->r[v_level[0]->nr - 1]; - gyro::dcntl[Param::THETA0] = v_level[0]->theta[0]; - gyro::dcntl[Param::THETA] = v_level[0]->theta[v_level[0]->ntheta - 1]; - - //split grid intervals in r and theta direction recursively in the middle to get a finer grid - if (gyro::icntl[Param::divideBy2] != 0) { - create_grid_polar_divide(); - } - - if (gyro::icntl[Param::verbose] > 1) { - std::cout << "System of size (nr x ntheta) = (" << v_level[0]->nr << " x " << v_level[0]->ntheta << ")\n"; - std::cout << "on the coordinates (r x theta): (" << gyro::dcntl[Param::R0] << ", " << gyro::dcntl[Param::R] - << ") x (" << gyro::dcntl[Param::THETA0] << ", " << gyro::dcntl[Param::THETA] << ")\n"; - } - if (gyro::icntl[Param::verbose] > 5) { - v_level[0]->display_r(); - v_level[0]->display_theta(); - std::cout << "\n"; - } - - if (!gyro::f_grid_r.empty() && gyro::icntl[Param::write_radii_angles] == 1) { - v_level[0]->write_grid_r(); - } - if (!gyro::f_grid_theta.empty() && gyro::icntl[Param::write_radii_angles] == 1) { - v_level[0]->write_grid_theta(); - } -} /* ----- end of gmgpolar::create_grid_polar ----- */ - -/*! - * \brief Build the array r - * - * Build the array r, containing the coordinates in the direction r, - * following an iso- or aniso-tropic division. - */ -void level::build_r() -{ - int nr_exp = gyro::icntl[Param::nr_exp]; - int aniso = gyro::icntl[Param::fac_ani]; - double R = gyro::dcntl[Param::R]; - double R0 = gyro::dcntl[Param::R0]; - - if (l > 0) - throw std::runtime_error("Function build_r should only be called on the finest grid"); - std::vector r_tmp; - if (!aniso) { - nr = pow(2, nr_exp - 1); - double fac = (R - R0) / nr; - r_tmp = std::vector(nr + 1); - for (int i = 0; i < nr; i++) { - r_tmp[i] = R0 + i * fac; - } - r_tmp[nr] = R; - nr++; - } - else { - // 1) uniform division with nr=2^dummy_lognr - 2^aniso - // 2) remaining nodes are added by refining the part centered around 2/3 of r - - std::set>::iterator itr, itr_p1; - // very ugly anisotropy hack.... dividing recursively smaller and smaller number of cells - - /* uniform division of r in 2^nr_exp - 2^aniso */ - int dummy_lognr = nr_exp; - int n_elems_equi = pow(2, dummy_lognr) - pow(2, aniso); - if (aniso < 0 || n_elems_equi <= 0) { - throw std::runtime_error("Please choose anisotropy factor a such that 2^fac_ani < 2^nr_exp.\n"); - } - - if ((aniso % 2) == 1) // odd number of elements on an open circular disk is desired because of coarsening - n_elems_equi++; - double fac = (R - R0) / n_elems_equi; - nr = n_elems_equi + 1; - std::vector r_tmp2 = std::vector(nr); - for (int i = 0; i < nr - 1; i++) - r_tmp2[i] = R0 + i * fac; - r_tmp2[nr - 1] = R; - - /* refine around 2/3 of r */ - int n_elems_refined = pow(2, aniso); - - // edge - int se; - - // allow refining of the grid at r_jump, the center point of the - // drop of the diffusion coefficient alpha. - double r_jump; - if (gyro::icntl[Param::alpha_coeff] == SONNENDRUCKER) { - // The center of the coefficient jump lies at 0.6888697651782026 - // for backward stability with previous runs and the Matlab code, - // we use 0.66 though. - r_jump = 0.66; - } - else if (gyro::icntl[Param::alpha_coeff] == ZONI) { - r_jump = 0.4837; - } - else if (gyro::icntl[Param::alpha_coeff] == ZONI_SHIFTED) { - // Choose center point of descent. - // a) - ln(0.5 * (alpha(0) - alpha(Rmax))): - // - ln(0.5 * (np.exp(-np.tanh(-14)) - np.exp(-np.tanh(6)))) = 0.16143743821247852 - // b) r_center = Rmax * (np.arctanh(0.16143743821247852) + 14) / 20 = 0.7081431124450334 Rmax - r_jump = 0.7081; - } - else if (gyro::icntl[Param::alpha_coeff] == POISSON) { - r_jump = 0.5; // There is no jump for Poisson so this is an arbitrary choice - } - else { - throw std::runtime_error("Unknown alpha coeff"); - } - if (floor(nr * r_jump) > nr - (n_elems_refined / 2)) { - int new_n_elems_exp = log2(nr - floor(nr * r_jump)) + 1; - n_elems_refined = pow(2, new_n_elems_exp); - } - se = floor(nr * r_jump) - n_elems_refined / 2; - int ee = se + n_elems_refined; - // takeout - int st = ceil((double)n_elems_refined / 4.0 + 1) - 1; - int et = floor(3 * ((double)n_elems_refined / 4.0)); - - std::set r_set; - std::set r_set_p1; - int count = 0; - for (int i = 0; i < n_elems_refined; i++) { - r_set_p1.insert(r_tmp2[se + i]); - count++; - } - double half = fac / 2.0; - for (int k = 0; k < aniso; k++) { - std::set r_set_p1_tmp; - itr_p1 = r_set_p1.begin(); - int r_size = count; - count = 0; - for (int i = 0; i < r_size - 1; i++) { - r_set.insert((*itr_p1) + half); - if (k < aniso - 1 && i >= st && i < et) { - r_set_p1_tmp.insert(*(itr_p1)); - r_set_p1_tmp.insert(*(itr_p1) + half); - count += 2; - } - itr_p1++; - } - r_set_p1 = r_set_p1_tmp; - half *= 0.5; - } - // such that the total size is 8*x+1 (or we do not refine) - nr = nr + r_set.size(); - int shift = 0; - shift = std::min(nr % 8 - 1, (int)r_set.size()); - itr = r_set.begin(); - std::advance(itr, shift); - r_set.erase(r_set.begin(), itr); - for (int i = 0; i < n_elems_refined; i++) - r_set.insert(r_tmp2[se + i]); - // group all in r_tmp - nr = n_elems_equi - n_elems_refined + r_set.size() + 1; - - r_tmp = std::vector(nr); - for (int i = 0; i < se; i++) - r_tmp[i] = r_tmp2[i]; - itr = r_set.begin(); - for (int i = 0; i < (int)r_set.size(); i++) { - r_tmp[se + i] = *itr; - itr++; - } - for (int i = 0; i < n_elems_equi - ee + 1; i++) - r_tmp[se + r_set.size() + i] = r_tmp2[ee + i]; - } - - // refine again by the middle - nr = 2 * nr - 1; - r = std::vector(nr); - for (int i = 0; i < nr; i++) { - if (!(i % 2)) - r[i] = r_tmp[i / 2]; - else - r[i] = 0.5 * (r_tmp[(i - 1) / 2] + r_tmp[(i + 1) / 2]); - } - if (gyro::icntl[Param::verbose] > 1) { - std::cout << "Parameter nr equals " + std::to_string(nr) << "." << std::endl; - } -} /* ----- end of level::build_r ----- */ - -/*! - * \brief Build the array theta - * - * Build the array theta, containing the coordinates in the direction theta, - * following an iso- or aniso-tropic division. - */ -void level::build_theta() -{ - // int ntheta_exp = gyro::icntl[Param::ntheta_exp]; - int periodic = gyro::icntl[Param::periodic]; - int aniso = gyro::icntl[Param::theta_aniso]; - - if (l > 0) - throw std::runtime_error("Function build_theta should only be called on the finest grid"); - if (aniso < 0 || aniso > 1) - throw std::runtime_error("Please choose anisotropy on theta as 0 or 1.\n"); - if (!aniso) { - ntheta = pow(2, ceil(log2(nr))); - double fac = 2 * PI / ntheta; - - // If not periodic BC on theta, last point is present (not implicit) - if (!periodic) - ntheta++; - - theta = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) - theta[i] = fac * i; - } - else { - if (gyro::icntl[Param::verbose] > 2) { - std::cout << "Anisotropy chosen in theta.\n"; - } - ntheta = pow(2, ceil(log2(nr)) - 1); - double fac = 2 * PI / ntheta; - - ntheta++; - std::vector theta_tmp = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) - theta_tmp[i] = fac * i; - for (int i = 1; i < ntheta - 3; i += 3) - theta_tmp[i] = theta_tmp[i] + 0.3 * (theta_tmp[i + 1] - theta_tmp[i]); - for (int i = 1; i < ntheta - 3; i += 5) - theta_tmp[i] = theta_tmp[i] + 0.5 * (theta_tmp[i + 1] - theta_tmp[i]); - - ntheta = 2 * ntheta - 1; - // If periodic BC on theta, last point is implicit - if (periodic) - ntheta--; - - theta = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) - if (!(i % 2)) - theta[i] = theta_tmp[i / 2]; - else - theta[i] = 0.5 * (theta_tmp[(i - 1) / 2] + theta_tmp[(i + 1) / 2]); - } -} /* ----- end of level::build_theta ----- */ - -/*! - * \brief Divides the intervals of the finest grid in half - * - * For a previsouly created finest polar grid, divides the intervals in half - * in both r and theta directions. Mainly used in order to compute order - * of approximations in tests (e.G. "implicitly extrapolated ..." paper). - * - */ -void gmgpolar::create_grid_polar_divide() -{ - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Dividing a coarser grid...\n"; - - int divide = gyro::icntl[Param::divideBy2]; - std::vector r_tmp; - std::vector theta_tmp; - - r_tmp = v_level[0]->r; - theta_tmp = v_level[0]->theta; - double last = v_level[0]->theta[v_level[0]->ntheta - 1]; - - //! divide the initial coarse grid at the center of the intervals - for (int k = 0; k < divide; k++) { //do this 'divide' times - std::vector r_tmp2; - std::vector theta_tmp2; - - //r - v_level[0]->nr = 2 * v_level[0]->nr - 1; //double the size of nr (fill gaps with new points) - r_tmp2 = std::vector(v_level[0]->nr); //new list for the coordinates (of larger size) - for (int i = 0; i < v_level[0]->nr; i++) { - if (!(i % 2)) - r_tmp2[i] = r_tmp[i / 2]; //use the available point - else - r_tmp2[i] = 0.5 * (r_tmp[(i - 1) / 2] + r_tmp[(i + 1) / 2]); //take the middle value - } - r_tmp = r_tmp2; - - //theta - if ((!fabs(last - 2 * PI)) < 1e-10 && gyro::icntl[Param::periodic]) { - v_level[0]->ntheta++; - theta_tmp2 = std::vector(v_level[0]->ntheta); - for (int i = 0; i < v_level[0]->ntheta - 1; ++i) { - theta_tmp2[i] = theta_tmp[i]; - } - theta_tmp2[v_level[0]->ntheta - 1] = 2 * PI; //add 2*PI to the theta array - theta_tmp = theta_tmp2; - } - - v_level[0]->ntheta = 2 * v_level[0]->ntheta - 1; //double the size of ntheta (fill gaps with new points) - theta_tmp2 = std::vector(v_level[0]->ntheta); - for (int i = 0; i < v_level[0]->ntheta; i++) { - if (!(i % 2)) - theta_tmp2[i] = theta_tmp[i / 2]; //use the available point - else - theta_tmp2[i] = 0.5 * (theta_tmp[(i - 1) / 2] + theta_tmp[(i + 1) / 2]); //take the middle value - } - - if (gyro::icntl[Param::periodic]) { - v_level[0]->ntheta--; - theta_tmp = std::vector(v_level[0]->ntheta); - for (int i = 0; i < v_level[0]->ntheta; ++i) { - theta_tmp[i] = theta_tmp2[i]; //leave out last value (2*PI) again - } - } - else { - theta_tmp = theta_tmp2; - } - } - - v_level[0]->r = r_tmp; - v_level[0]->theta = theta_tmp; - - gyro::dcntl[Param::R0] = v_level[0]->r[0]; - gyro::dcntl[Param::R] = v_level[0]->r[v_level[0]->nr - 1]; - gyro::dcntl[Param::THETA0] = v_level[0]->theta[0]; - gyro::dcntl[Param::THETA] = v_level[0]->theta[v_level[0]->ntheta - 1]; -} /* ----- end of level::create_grid_polar_divide ----- */ diff --git a/src/debug.cpp b/src/debug.cpp deleted file mode 100644 index b398f35e..00000000 --- a/src/debug.cpp +++ /dev/null @@ -1,576 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file debug.cpp - * \brief Comparison of function results with the matlab code (A, f, P, smoothers) - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gmgpolar.h" - -inline void unit_test(std::stringstream& fname, int m, std::vector& uC, std::string vect_name, int test) -{ - std::fstream f; - std::vector data; - if (gyro::icntl[Param::debug] == 1) { - f.open(fname.str().c_str(), std::ios::in); - if (!f) { - std::cout << "No such file: " << fname.str() << "\n"; - } - else { - while (1) { - double p; - f >> p; - if (f.eof()) - break; - data.push_back(p); - } - } - f.close(); - fname.clear(); - fname.str(std::string()); - if (data.size() == 0) { - std::cout << "Warning: array to test is empty."; - } - else { - if (test && data.size() > 0) { - for (int i = 0; i < m; i++) { - if (fabs(uC[i] - data[i]) > 1e-12) - std::cout << "i: " << i << ", uC[i]: " << uC[i] << ", " << vect_name << ": " << data[i] << "\n"; - assert(fabs(uC[i] - data[i]) < 1e-12); - } - } - if (!test) { - uC = data; - } - } - } - else { - if (test && uC.size() == 0) { - std::cout << "Warning: array to test is empty.\n"; - return; - } - if (!test) - std::srand(static_cast(std::time(nullptr))); - f.open(fname.str().c_str(), std::ios::out); - fname.clear(); - fname.str(std::string()); - if (!f) { - std::cout << "No such file\n"; - } - else { - for (int j = 0; j < m; j++) { - if (!test) { - double random_nb = (double)std::rand() / (double)RAND_MAX; - uC.push_back(random_nb); - } - f << std::setprecision(17) << uC[j] << "\n"; - } - } - f.close(); - fname.clear(); - fname.str(std::string()); - } -} - -inline void unit_test(std::stringstream& fname, int m, std::vector& uC, std::string vect_name, int test) -{ - std::fstream f; - std::vector data; - if (gyro::icntl[Param::debug] == 1) { - f.open(fname.str().c_str(), std::ios::in); - if (!f) { - std::cout << "No such file: " << fname.str() << "\n"; - } - else { - while (1) { - int p; - f >> p; - if (f.eof()) - break; - data.push_back(p); - } - } - f.close(); - fname.clear(); - fname.str(std::string()); - if (data.size() == 0) { - std::cout << "Warning: array to test is empty."; - } - else { - for (int i = 0; i < m; i++) { - if (uC[i] != data[i]) - std::cout << "i: " << i << ", uC[i]: " << uC[i] << ", " << vect_name << ": " << data[i] << "\n"; - assert(uC[i] == data[i]); - } - } - } - else { - if (uC.size() == 0) { // Sometimes Asc is empty - std::cout << "Warning: array to test is empty.\n"; - return; - } - f.open(fname.str().c_str(), std::ios::out); - fname.clear(); - fname.str(std::string()); - if (!f) { - std::cout << "No such file\n"; - } - else { - for (int j = 0; j < m; j++) { - f << std::setprecision(17) << uC[j] << "\n"; - } - } - f.close(); - fname.clear(); - fname.str(std::string()); - } -} - -/*! - * \brief Check the implementation - * - * Compare the results of the current implementation with - * structures extracted from the MATLAB implementation. - * - */ -void gmgpolar::debug() -{ - std::stringstream ss, folder, fname; - std::fstream f, fr, fc; - int optimized = gyro::icntl[Param::optimized]; - int DirBC_Interior = gyro::icntl[Param::DirBC_Interior]; - int smoother = gyro::icntl[Param::smoother]; - int extrapolation = gyro::icntl[Param::extrapolation]; - double R = gyro::dcntl[Param::R]; - int prob = gyro::icntl[Param::prob]; - int mod_pk = gyro::icntl[Param::mod_pk]; - int alpha = gyro::icntl[Param::alpha_coeff]; - int beta = gyro::icntl[Param::beta_coeff]; - - ss << "debug_data/"; - if (gyro::icntl[Param::debug] != 1) { - const int dir_err0 = mkdir(ss.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - // if (-1 == dir_err0) { - // printf("Error creating directory!\n"); - // } - } - - ss << "OPTI-" << optimized << "_BC-" << DirBC_Interior << "_SMOOTH-" << smoother << "_EXTR-" << extrapolation - << "_R-" << R << "_PROB-" << prob << "_GEOM-" << mod_pk << "_A-" << alpha << "_B-" << beta << "/"; - - if (gyro::icntl[Param::debug] != 1) { - const int dir_err1 = mkdir(ss.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - // if (-1 == dir_err1) { - // printf("Error creating directory!\n"); - // } - } - - /////////////////////////////////////////////////////////// - // Parameters: params.txt (compute_rho, cycle, delta_e, fac_ani, kappa_eps, levels, maxiter, mod_pk, nr, ntheta, periodic, plotit, R0, r0_DB, rDBC(1), rDBC(2), Rmax, solveit, v1, v2) - /////////////////////////////////////////////////////////// - std::cout << "Checking parameters...\n"; - fname << ss.str() << "params.txt"; - std::vector parray; - if (gyro::icntl[Param::debug] == 1) { - f.open(fname.str().c_str(), std::ios::in); - if (!f) { - std::cout << "No such file: " << fname.str() << "\n"; - } - else { - while (1) { - double p; - f >> p; - parray.push_back(p); - // std::cout << p << "\n"; - if (f.eof()) - break; - } - - assert(gyro::icntl[Param::optimized] == parray[0]); - // assert(gyro::icntl[Param::verbose] == parray[1]); - // assert(gyro::icntl[Param::openmp] == parray[2]); - // assert(gyro::icntl[Param::matrix_free] == parray[3]); - // assert(gyro::icntl[Param::debug] == parray[1]); - assert(gyro::icntl[Param::nr_exp] == (int)parray[1]); - assert(gyro::icntl[Param::ntheta_exp] == (int)parray[2]); - assert(gyro::icntl[Param::fac_ani] == (int)parray[3]); - assert(gyro::icntl[Param::theta_aniso] == (int)parray[4]); - assert(gyro::icntl[Param::v1] == (int)parray[5]); - assert(gyro::icntl[Param::v2] == (int)parray[6]); - assert(gyro::icntl[Param::cycle] == (int)parray[7]); - assert(gyro::icntl[Param::mod_pk] == (int)parray[8]); - assert(gyro::icntl[Param::compute_rho] == (int)parray[9]); - assert(gyro::icntl[Param::level] == (int)parray[10]); - assert(gyro::icntl[Param::plotit] == (int)parray[11]); - assert(gyro::icntl[Param::solveit] == (int)parray[12]); - assert(gyro::icntl[Param::maxiter] == (int)parray[13]); - assert(gyro::icntl[Param::periodic] == (int)parray[14]); - assert(gyro::icntl[Param::origin_NOT_coarse] == (int)parray[15]); - assert(gyro::icntl[Param::smoother] == (int)parray[16]); - assert(gyro::icntl[Param::discr] == (int)parray[17]); - assert(gyro::icntl[Param::extrapolation] == (int)parray[18]); - assert(gyro::icntl[Param::DirBC_Interior] == (int)parray[19]); - assert(gyro::icntl[Param::paraview] == (int)parray[20]); - assert(gyro::icntl[Param::divideBy2] == (int)parray[21]); - assert(gyro::icntl[Param::prob] == (int)parray[22]); - assert(gyro::icntl[Param::alpha_coeff] == (int)parray[23]); - assert(gyro::icntl[Param::beta_coeff] == (int)parray[24]); - assert(gyro::icntl[Param::res_norm] == (int)parray[25]); - assert(fabs(gyro::dcntl[Param::r0_DB] - parray[26]) < 1e-12); - assert(fabs(gyro::dcntl[Param::R0] - parray[27]) < 1e-12); - assert(fabs(gyro::dcntl[Param::R] - parray[28]) < 1e-12); - assert(fabs(gyro::dcntl[Param::THETA0] - parray[29]) < 1e-12); - assert(fabs(gyro::dcntl[Param::THETA] - parray[30]) < 1e-12); - assert(fabs(gyro::dcntl[Param::kappa_eps] - parray[31]) < 1e-12); - assert(fabs(gyro::dcntl[Param::delta_e] - parray[32]) < 1e-12); - assert(fabs(gyro::dcntl[Param::tol_bound_check] - parray[33]) < 1e-12); - assert(fabs(gyro::dcntl[Param::rel_red_conv] - parray[34]) < 1e-12); - } - f.close(); - fname.clear(); //clear any bits set - fname.str(std::string()); - } - else { - f.open(fname.str().c_str(), std::ios::out); - if (!f) { - std::cout << "No such file: " << fname.str() << "\n"; - } - else { - f << gyro::icntl[Param::optimized] << "\n"; - // f << gyro::icntl[Param::verbose] << "\n"; - // f << gyro::icntl[Param::openmp] << "\n"; - // f << gyro::icntl[Param::matrix_free] << "\n"; - // f << gyro::icntl[Param::debug] << "\n"; - f << gyro::icntl[Param::nr_exp] << "\n"; - f << gyro::icntl[Param::ntheta_exp] << "\n"; - f << gyro::icntl[Param::fac_ani] << "\n"; - f << gyro::icntl[Param::theta_aniso] << "\n"; - f << gyro::icntl[Param::v1] << "\n"; - f << gyro::icntl[Param::v2] << "\n"; - f << gyro::icntl[Param::cycle] << "\n"; - f << gyro::icntl[Param::mod_pk] << "\n"; - f << gyro::icntl[Param::compute_rho] << "\n"; - f << gyro::icntl[Param::level] << "\n"; - f << gyro::icntl[Param::plotit] << "\n"; - f << gyro::icntl[Param::solveit] << "\n"; - f << gyro::icntl[Param::maxiter] << "\n"; - f << gyro::icntl[Param::periodic] << "\n"; - f << gyro::icntl[Param::origin_NOT_coarse] << "\n"; - f << gyro::icntl[Param::smoother] << "\n"; - f << gyro::icntl[Param::discr] << "\n"; - f << gyro::icntl[Param::extrapolation] << "\n"; - f << gyro::icntl[Param::DirBC_Interior] << "\n"; - f << gyro::icntl[Param::paraview] << "\n"; - f << gyro::icntl[Param::divideBy2] << "\n"; - f << gyro::icntl[Param::prob] << "\n"; - f << gyro::icntl[Param::alpha_coeff] << "\n"; - f << gyro::icntl[Param::beta_coeff] << "\n"; - f << gyro::icntl[Param::res_norm] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::r0_DB] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::R0] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::R] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::THETA0] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::THETA] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::kappa_eps] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::delta_e] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::tol_bound_check] << "\n"; - f << std::setprecision(17) << gyro::dcntl[Param::rel_red_conv] << "\n"; - } - f.close(); - fname.clear(); //clear any bits set - fname.str(std::string()); - } - - // std::cout << "No test on the size of the i,j,val vectors: explicit zeros removed in matlab.\n"; - - std::vector u_rand0; - for (int l = 0; l < levels; l++) { - std::cout << "--------- debug on level " << l << "--------- \n"; - folder << ss.str() << l << "/"; - int m = v_level[l]->m; - - if (gyro::icntl[Param::debug] == 1) { - const int dir_err2 = mkdir(folder.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - // if (-1 == dir_err2) { - // printf("Error creating directory!\n"); - // } - } - - // Random test vector - std::vector u_rand; - fname << folder.str() << "rand.txt"; - unit_test(fname, m, u_rand, "u_rand", 0); - if (l == 0) - u_rand0 = u_rand; - - /////////////////////////////////////////////////////////// - // Grids: r.txt, theta.txt - /////////////////////////////////////////////////////////// - std::cout << "Checking grid (r, theta)...\n"; - std::vector r_tmp, theta_tmp; - - fname << folder.str() << "r.txt"; - unit_test(fname, v_level[l]->nr, v_level[l]->r, "v_level[l]->r", 1); - - fname << folder.str() << "theta.txt"; - unit_test(fname, v_level[l]->ntheta, v_level[l]->theta, "v_level[l]->theta", 1); - - /////////////////////////////////////////////////////////// - // Linear problem: - /////////////////////////////////////////////////////////// - // - row_indices.txt, col_indices.txt, vals.txt - std::cout << "Checking Operator A...\n"; - std::vector uC(m, 0); - if (gyro::icntl[Param::optimized] == 0) - v_level[l]->apply_A0(u_rand, uC); - else - v_level[l]->apply_A(u_rand, uC); - fname << folder.str() << "Au.txt"; - unit_test(fname, m, uC, "Au", 1); - - // - row_Ac_LU.txt, col_Ac_LU.txt, vals_Ac_LU.txt - if (l == levels - 1) { - std::cout << "Checking Coarsest grid Ac...\n"; - uC = std::vector(m, 0); - for (std::size_t j = 0; j < u_rand.size(); j++) { - uC[v_level[l]->row_Ac_LU[j]] += v_level[l]->vals_Ac_LU[j] * u_rand[v_level[l]->col_Ac_LU[j]]; - } - fname << folder.str() << "Acu.txt"; - unit_test(fname, m, uC, "Acu", 1); - - uC = std::vector(m, 0); - std::cout << "Checking Operator Ac^-1...\n"; - fname << folder.str() << "Acinvu.txt"; - std::vector Ainv_coarse = v_level[l]->solve_gaussian_elimination( - v_level[l]->row_Ac_LU, v_level[l]->col_Ac_LU, v_level[l]->vals_Ac_LU, u_rand); - unit_test(fname, m, uC, "Acinvu", 1); - } - - // - f.txt - if (l == 0 || (l == 1 && gyro::icntl[Param::extrapolation] > 0)) { - std::cout << "Checking RHS...\n"; - fname << folder.str() << "f.txt"; - unit_test(fname, m, v_level[l]->fVec, "v_level[l]->fVec", 1); - } - - // - betaVec.txt - if (gyro::icntl[Param::beta_coeff] > 0) { - std::cout << "Checking Beta vector...\n"; - fname << folder.str() << "betaVec.txt"; - unit_test(fname, v_level[l]->betaVec.size(), v_level[l]->betaVec, "v_level[l]->betaVec", 1); - } - - /////////////////////////////////////////////////////////// - // Multigrid (l-1): - if (l == levels - 1) - break; - /////////////////////////////////////////////////////////// - int mc = v_level[l]->mc; - - // - coarse_nodes_r.txt, coarse_nodes_theta.txt - std::cout << "Checking coarse grids r...\n"; - fname << folder.str() << "coarse_nodes_r.txt"; - unit_test(fname, v_level[l]->coarse_nodes_list_r.size(), v_level[l]->coarse_nodes_list_r, - "v_level[l]->coarse_nodes_list_r", 1); - - std::cout << "Checking coarse grids theta...\n"; - fname << folder.str() << "coarse_nodes_theta.txt"; - unit_test(fname, v_level[l]->coarse_nodes_list_theta.size(), v_level[l]->coarse_nodes_list_theta, - "v_level[l]->coarse_nodes_list_theta", 1); - - // - row_indices_prol.txt, col_indices_prol.txt, vals_prol.txt - std::cout << "Checking Prolongation P...\n"; - fname << folder.str() << "Pu.txt"; - if (gyro::icntl[Param::optimized] == 0) - uC = v_level[l]->apply_prolongation_bi0(u_rand, mc, m, v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - else - uC = v_level[l]->apply_prolongation_bi(u_rand); - unit_test(fname, m, uC, "Pu", 1); - - if (gyro::icntl[Param::extrapolation] > 0 && l == 0) { - // - row_indices_prol_ex.txt, col_indices_prol_ex.txt, vals_prol_ex.txt - std::cout << "Checking Prolongation Pex...\n"; - fname << folder.str() << "Pexu.txt"; - if (gyro::icntl[Param::optimized] == 0) - uC = v_level[l]->apply_prolongation_ex0(u_rand, mc, m, v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - else - uC = v_level[l]->apply_prolongation_ex(u_rand); - unit_test(fname, m, uC, "Pexu", 1); - - // - row_indices_prol_inj.txt, col_indices_prol_inj.txt, vals_prol_inj.txt - std::cout << "Checking Prolongation Pinj...\n"; - fname << folder.str() << "Pinju.txt"; - if (gyro::icntl[Param::optimized] == 0) - uC = v_level[l]->apply_prolongation_inj0(u_rand, mc, m, v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - else - uC = v_level[l]->apply_prolongation_inj(u_rand); - unit_test(fname, m, uC, "Pinju", 1); - } - - // - row_indices_Asc_s_c.txt, col_indices_Asc_s_c.txt, vals_Asc_s_c.txt - std::cout << "Checking Smoother Matrices Asc...\n"; - uC.clear(); - int start = 0, end = 0; - std::vector Ascu; - for (int smoother = 0; smoother < 2; smoother++) { - for (int color = 0; color < 2; color++) { - int smoother_ind = smoother * 2 + color; - int m_sc = v_level[l]->m_sc[smoother_ind]; - for (int ij = 0; ij < v_level[l]->nblocks[smoother_ind]; ij++) { - start = end; - end += m_sc; - std::vector::const_iterator first = u_rand.begin() + start; - std::vector::const_iterator last = u_rand.begin() + end; - std::vector u_rand_sc(first, last); - Ascu = std::vector(m_sc, 0); - for (int j = 0; j < v_level[l]->A_Zebra_r_LU_row[smoother_ind][ij].size(); j++) { - Ascu[v_level[l]->A_Zebra_r_LU_row[smoother_ind][ij][j]] += - v_level[l]->A_Zebra_v_LU_row[smoother_ind][ij][j] * - u_rand_sc[v_level[l]->A_Zebra_c_LU_row[smoother_ind][ij][j]]; - } - uC.insert(uC.end(), Ascu.begin(), Ascu.end()); - } - } - } - fname << folder.str() << "Ascu.txt"; - unit_test(fname, m, uC, "Ascu", 1); - - std::cout << "Checking Asc^-1...\n"; - uC.clear(); - start = 0; - end = 0; - std::vector Ascinvu; - for (int smoother = 0; smoother < 2; smoother++) { - for (int color = 0; color < 2; color++) { - int smoother_ind = smoother * 2 + color; - int m_sc = v_level[l]->m_sc[smoother_ind]; - for (int ij = 0; ij < v_level[l]->nblocks[smoother_ind]; ij++) { - start = end; - end += m_sc; - std::vector::const_iterator first = u_rand.begin() + start; - std::vector::const_iterator last = u_rand.begin() + end; - std::vector u_rand_sc(first, last); - if (v_level[l]->A_Zebra_r_row[smoother_ind][ij].size() == 0) { - continue; - } - // Dirichlet or size of system is 1 (diagonal solve) - if ((smoother_ind == 0 && ij == 0 && gyro::icntl[Param::DirBC_Interior]) || m_sc == 1 || - (gyro::icntl[Param::extrapolation] && l == 0 && smoother_ind % 2 == 0 && - !(smoother_ind == 0 && !gyro::icntl[Param::DirBC_Interior] && ij == 0))) { - Ascinvu = v_level[l]->solve_diag(v_level[l]->A_Zebra_v_row[smoother_ind][ij], u_rand_sc); - } - // Circle (not across) - else if (smoother_ind < 2 && - !(smoother_ind == 0 && !gyro::icntl[Param::DirBC_Interior] && ij == 0)) { - Ascinvu = v_level[l]->solve_circle(v_level[l]->A_Zebra_r_LU_row[smoother_ind][ij], - v_level[l]->A_Zebra_c_LU_row[smoother_ind][ij], - v_level[l]->A_Zebra_v_LU_row[smoother_ind][ij], u_rand_sc); - } - // Radial (not across) - else if (smoother_ind > 1) { - Ascinvu = v_level[l]->solve_radial(v_level[l]->A_Zebra_r_LU_row[smoother_ind][ij], - v_level[l]->A_Zebra_c_LU_row[smoother_ind][ij], - v_level[l]->A_Zebra_v_LU_row[smoother_ind][ij], u_rand_sc); - } - // Across (direct solver) - else { - Ascinvu = v_level[l]->solve_gaussian_elimination(v_level[l]->A_Zebra_r_LU_row[smoother_ind][ij], - v_level[l]->A_Zebra_c_LU_row[smoother_ind][ij], - v_level[l]->A_Zebra_v_LU_row[smoother_ind][ij], - u_rand_sc); - } - uC.insert(uC.end(), Ascinvu.begin(), Ascinvu.end()); - } - } - } - fname << folder.str() << "Ascinvu.txt"; - unit_test(fname, m, uC, "Ascinvu", 1); - - // - row_indices_Asc_ortho_s_c.txt, col_indices_Asc_ortho_s_c.txt, vals_Asc_ortho_s_c.txt - std::cout << "Checking Smoother Complement Matrices Asc_ortho...\n"; - uC.clear(); - for (int smoother = 0; smoother < 2; smoother++) { - for (int color = 0; color < 2; color++) { - int smoother_ind = smoother * 2 + color; - int m_sc = v_level[l]->nblocks[smoother_ind] * v_level[l]->m_sc[smoother_ind]; - std::vector Asc_orthou(m_sc, 0); - v_level[l]->u = u_rand; - if (gyro::icntl[Param::optimized] == 0) - v_level[l]->apply_Asc_ortho0(Asc_orthou, smoother_ind); - else { - int sm = (smoother_ind < 2) ? 1 - smoother_ind : 5 - smoother_ind; - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - v_level[l]->apply_Asc_ortho(Asc_orthou, v_level[l]->u, smoother_ind, 0, 0, - v_level[l]->dep_Asc[smoother_ind], v_level[l]->dep_Asc[sm], - v_level[l]->dep_Asc[1], v_level[l]->dep_Asc[smoother_ind]); - } - else { //radial - v_level[l]->apply_Asc_ortho(Asc_orthou, v_level[l]->u, smoother_ind, 0, 0, - v_level[l]->dep_Asc[smoother_ind], v_level[l]->dep_Asc[sm], - v_level[l]->dep_Asc[1], v_level[l]->dep_Asc[smoother_ind]); - } - } - else { - v_level[l]->apply_Asc_ortho(Asc_orthou, v_level[l]->u, smoother_ind, 0, 0, - v_level[l]->dep_Asc[smoother_ind], v_level[l]->dep_Asc[sm], - v_level[l]->dep_Asc[1], v_level[l]->dep_Asc_ortho[smoother_ind]); - } - } - uC.insert(uC.end(), Asc_orthou.begin(), Asc_orthou.end()); - } - } - fname << folder.str() << "Asc_orthou.txt"; - unit_test(fname, m, uC, "Asc_orthou", 1); - - folder.clear(); //clear any bits set - folder.str(std::string()); - } - - /////////////////////////////////////////////////////////// - // Checking whole multigrid cycle - /////////////////////////////////////////////////////////// - std::cout << "Checking multigrid iteration...\n"; - v_level[0]->u = u_rand0; - if (gyro::icntl[Param::extrapolation] > 0) - v_level[1]->fVec_initial = v_level[1]->fVec; //Extrapolation: store the initial fVec on level 1 - multigrid_cycle_extrapol(0); - fname << ss.str() << "0/MG_cycle_rand.txt"; - unit_test(fname, v_level[0]->m, v_level[0]->u, "MG_cycle_rand", 1); - - std::cout << "Checking residual...\n"; - std::vector res_M; - compute_residual(0, gyro::icntl[Param::extrapolation]); - fname << ss.str() << "0/error_residual.txt"; - unit_test(fname, v_level[0]->m, v_level[0]->res, "residual", 1); - - std::cout << "Checking error...\n"; - std::vector error_M; - std::vector error = compute_error(); - fname << ss.str() << "0/error_rand.txt"; - unit_test(fname, v_level[0]->m, error, "error", 1); -} /* ----- end of gmgpolar::debug ----- */ diff --git a/src/define_coarse_nodes.cpp b/src/define_coarse_nodes.cpp deleted file mode 100644 index e3ee764f..00000000 --- a/src/define_coarse_nodes.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file define_coarse_nodes.cpp - * \brief Implementation of the coarsening - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gmgpolar.h" -#include "level.h" - -/*! - * \brief Define the coarse nodes on all levels - * - * Defines coarse nodes on all level (two columns per level) by recursively - * calling define_coarse_nodes_onelevel(); using a vector of arrays r/theta - * to store the different levels. - * - nodes are ordered (per level) circlewise starting with r_min (here r_0, in - * article denoted r_1) - * - [-1, -1]: means that this node is not a coarse node - * [m, n]: means that this node (with r_m+1 and theta_n) is coarse node - * - */ -void gmgpolar::define_coarse_nodes() -{ - // int periodic = gyro::icntl[Param::periodic]; - - for (int i = 1; i < levels; i++) { - level* new_level = new level(i); - v_level.push_back(new_level); - } - levels_orig = levels; - for (int i = 0; i < levels; i++) { - if (gyro::icntl[Param::verbose] > 3) - std::cout << "=> Defining coarse nodes on level " << i << "\n"; - v_level[i]->store_theta_n_co(); - if (i < levels - 1) { - v_level[i]->define_coarse_nodes_onelevel(v_level[i + 1]); - } - if (gyro::icntl[Param::verbose] > 3) { - std::cout << "level: " << i; - if (i != levels - 1) - std::cout << ", coarse_nodes: " << v_level[i]->coarse_nodes; - std::cout << std::endl; - std::cout << "nr: " << v_level[i]->nr << ", ntheta: " << v_level[i]->ntheta << "\n"; - } - if (i != levels - 1 && - (v_level[i]->nr % 2 != 1 || v_level[i]->nr < 5 || v_level[i]->ntheta % 2 != 0 || v_level[i]->ntheta < 8)) { - std::cout << "WARNING: Cannot reach the desired number of levels (" << levels << "). Replacing it with " - << i + 1 << "...\n"; - ; - levels = i + 1; - break; - } - } -} /* ----- end of gmgpolar::define_coarse_nodes ----- */ - -/*! - * \brief Define the coarse nodes on one level - * - * defines coarse nodes on one level (two columns) - * - nodes are ordered circlewise starting with r_min (here r_0, in article - * denoted r_1) - * - [-1, -1]: means that this node is not a coarse node - * [m, n]: means that this node (with r_m+1 and theta_n) is coarse node - * - * \param coarser: the next coarser level - * - */ -void level::define_coarse_nodes_onelevel(level* coarser) -{ - // int periodic = gyro::icntl[Param::periodic]; - - // int count_coarse = 0, type; - std::set indices_r; - std::set indices_theta; - coarse_nodes = (nr_int + 1) * ntheta_int; - coarse_nodes_list_r = std::vector(coarse_nodes, -1); - coarse_nodes_list_theta = std::vector(coarse_nodes, -1); - for (int j = 0; j < nr_int + 1; j += 2) { - for (int i = 0; i < ntheta_int; i += 2) { - - coarse_nodes_list_r[j * ntheta_int + i] = j; - coarse_nodes_list_theta[j * ntheta_int + i] = i; - - indices_r.insert(j); - indices_theta.insert(i); - } - } - - std::set>::iterator itr_r, itr_theta; - - coarser->nr = (int)indices_r.size(); - coarser->r = std::vector(coarser->nr); - coarser->ntheta = (int)indices_theta.size(); - coarser->theta = std::vector(coarser->ntheta); - - itr_r = indices_r.begin(); - for (int i = 0; i < coarser->nr; i++) { - coarser->r[i] = r[*itr_r]; - itr_r++; - } - - itr_theta = indices_theta.begin(); - for (int i = 0; i < coarser->ntheta; i++) { - coarser->theta[i] = theta[*itr_theta]; - itr_theta++; - } - - if (gyro::icntl[Param::verbose] > 5) { - display_r(); - display_theta(); - std::cout << "Coarse grid: \n"; - gyro::disp(coarse_nodes_list_r, "coarse_nodes_list_r"); - gyro::disp(coarse_nodes_list_theta, "coarse_nodes_list_theta"); - } -} /* ----- end of level::define_coarse_nodes_onelevel ----- */ - -/*! - * \brief Define the coarse nodes on one level - * - * defines coarse nodes on one level (two columns) - * - nodes are ordered circlewise starting with r_min (here r_0, in article - * denoted r_1) - * - [-1, -1]: means that this node is not a coarse node - * [m, n]: means that this node (with r_m+1 and theta_n) is coarse node - * - */ -void level::store_theta_n_co() -{ - // Define number of intervals - nr_int = nr - 1; - ntheta_int = ntheta; - if (fabs(theta[ntheta - 1] - 2 * PI) < 1e-10) // check if end is 2*Pi (for periodic boundary conditions) - ntheta_int--; - if (ntheta_int % 2) - std::cout << "WARNING: The number of thetas is odd. Please use even numbers only.\n"; - - // To take first/last theta into account without conditions: - // - theta_per = [theta_last, theta, 2PI] - theta_per = std::vector(ntheta_int + 2); - theta_per[0] = theta[ntheta_int - 1]; - for (int i = 0; i < ntheta_int; i++) - theta_per[i + 1] = theta[i]; - theta_per[ntheta_int + 1] = 2 * PI; - - cos_theta_per = std::vector(ntheta_int + 2); - sin_theta_per = std::vector(ntheta_int + 2); - for (int i = 0; i < ntheta_int + 2; i++) { - cos_theta_per[i] = cos(theta_per[i]); - sin_theta_per[i] = sin(theta_per[i]); - } - - // Store cosines/sines (expensive) - cos_theta = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) { - cos_theta[i] = cos(theta[i]); - } - sin_theta = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) { - sin_theta[i] = sin(theta[i]); - } - - // Store theta+PI (only O(ntheta)) and associated cosines/sines (expensive) - theta_PI = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) { - theta_PI[i] = theta[i] + PI; - } - cos_theta_PI = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) { - cos_theta_PI[i] = cos(theta_PI[i]); - } - sin_theta_PI = std::vector(ntheta); - for (int i = 0; i < ntheta; i++) { - sin_theta_PI[i] = sin(theta_PI[i]); - } - - // Size of intervals in theta - // thetaplus = [k_last, thetaplus, k_last] - thetaplus = std::vector(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - thetaplus[i] = theta[i + 1] - theta[i]; - thetaplus[ntheta_int - 1] = 2 * PI - theta[ntheta_int - 1]; - - // Size of intervals in theta - // thetaplus_per = [k_last, thetaplus, k_last] - thetaplus_per = std::vector(ntheta_int + 1); - for (int i = 1; i < ntheta_int; i++) - thetaplus_per[i] = theta_per[i + 1] - theta_per[i]; - thetaplus_per[ntheta_int] = 2 * PI - theta_per[ntheta_int]; - thetaplus_per[0] = thetaplus_per[ntheta_int]; - - // Size of intervals in r - hplus = std::vector(nr_int); - for (int i = 0; i < nr_int; i++) - hplus[i] = r[i + 1] - r[i]; - - if (gyro::icntl[Param::verbose] > 5) { - gyro::disp(theta_per, "theta_per"); - gyro::disp(cos_theta, "cos_theta"); - gyro::disp(sin_theta, "sin_theta"); - gyro::disp(theta_PI, "theta_PI"); - gyro::disp(cos_theta_PI, "cos_theta_PI"); - gyro::disp(sin_theta_PI, "sin_theta_PI"); - gyro::disp(thetaplus, "thetaplus"); - gyro::disp(thetaplus_per, "thetaplus_per"); - gyro::disp(hplus, "hplus"); - } -} /* ----- end of level::store_theta_n_co ----- */ diff --git a/src/direct_solve.cpp b/src/direct_solve.cpp deleted file mode 100644 index 4b021225..00000000 --- a/src/direct_solve.cpp +++ /dev/null @@ -1,815 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file direct_solve.cpp - * \brief Implementation of the direct solver for the coarse grid operator and the smoother - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "level.h" - -#ifdef GMGPOLAR_USE_MUMPS -/*! - * \brief Initialization of a MUMPS structure - * - * Initialize the MUMPS structure: calls dmumps_c with job=-1 - * - * \param mumps: the structure - */ -void level::init_mumps(DMUMPS_STRUC_C& mumps) -{ - mumps.sym = 0; // symmetric - mumps.par = 1; // working host - mumps.comm_fortran = -987654; // MPI_COMM_WORLD - mumps.job = -1; // Initialization - - dmumps_c(&mumps); -} /* ----- end of level::init_mumps ----- */ - -/*! - * \brief Analysis and factorization with MUMPS (no RHS) - * - * Analysis and factorization with MUMPS (no RHS): calls dmumps_c with job=4 - * - * \param mumps: the structure - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param m_solution: size of the solutions in MUMPS - */ -void level::facto_mumps(DMUMPS_STRUC_C& mumps, std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, int m_solution) -{ - int nz = A_row_indices.size(); - mumps.job = 4; - mumps.n = m_solution; - mumps.nz = nz; - mumps.irn = new int[nz]; - mumps.jcn = new int[nz]; - mumps.a = new double[nz]; - for (int j = 0; j < nz; j++) { - mumps.irn[j] = A_row_indices[j] + 1; - mumps.jcn[j] = A_col_indices[j] + 1; - mumps.a[j] = A_vals[j]; - } - mumps.lrhs = mumps.n; - mumps.nrhs = 1; - mumps.rhs = new double[mumps.lrhs]; - mumps.ICNTL(1) = 0; - mumps.ICNTL(2) = 0; - mumps.ICNTL(3) = 0; - mumps.ICNTL(4) = 0; - mumps.ICNTL(7) = 5; - dmumps_c(&(mumps)); - mumps.job = 3; -} /* ----- end of level::facto_mumps ----- */ - -/*! - * \brief Solve with MUMPS on a specific RHS - * - * Solve with MUMPS on a specific RHS: calls dmumps_c with job=3 - * - * \param mumps: the structure - * \param f: the RHS - */ -std::vector level::solve_mumps(DMUMPS_STRUC_C& mumps, std::vector f) -{ - std::vector sol(mumps.lrhs); - - for (int i = 0; i < mumps.lrhs; i++) { - mumps.rhs[i] = f[i]; - } - dmumps_c(&(mumps)); - for (int i = 0; i < mumps.lrhs; i++) { - sol[i] = mumps.rhs[i]; - } - - return sol; -} /* ----- end of level::solve_mumps ----- */ - -/*! - * \brief Finalization of a MUMPS structure - * - * Finalization the MUMPS structure: calls dmumps_c with job=-2 - * - * \param mumps: the structure - */ -void level::finalize_mumps(DMUMPS_STRUC_C& mumps) -{ - int job_cur = mumps.job; - mumps.job = -2; - mumps.ICNTL(1) = 0; - mumps.ICNTL(2) = 0; - mumps.ICNTL(3) = 0; - mumps.ICNTL(4) = 0; - dmumps_c(&mumps); - if (job_cur == 3) { - delete[] mumps.a; - delete[] mumps.irn; - delete[] mumps.jcn; - delete[] mumps.rhs; - } -} /* ----- end of level::finalize_mumps ----- */ -#endif - -/*! - * \brief Factorization of A using an in-house sparse solver - * - * Factorization of A using an in-house sparse solver - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param m_solution: size of the solutions in MUMPS - */ -void level::facto_gaussian_elimination(std::vector& A_row_indices, std::vector& A_col_indices, - std::vector& A_vals, int m_solution) - -{ - // Factorization with Gaussian elimination - int row = A_row_indices[0]; - double pivot; - std::vector cols; - std::vector vals; - std::vector rows_L; - std::vector vals_L; - - std::vector A_row_ptr(m_solution + 1, 0); - int count = 1; - for (std::size_t k = 0; k < A_row_indices.size() + 1; ++k) { - if (k == A_row_indices.size() || A_row_indices[k] != row) { - A_row_ptr[count] = k; - count++; - if (k != A_row_indices.size()) - row = A_row_indices[k]; - } - } - - row = A_row_indices[0]; - // Go through the list and accumulate the elements of a same row (assume increasing rows) - for (std::size_t k = 0; k < A_row_indices.size() + 1; ++k) { - - // If new row, construct col of L and row of U - if (k == A_row_indices.size() || row != A_row_indices[k]) { - // Update the column of L with L(j,k) = U(j,k) / U(k,k) - // i.e. to save storage: A(j,k) = A(j,k) / A(k,k), j > k - for (std::size_t j = k; j < A_row_indices.size(); ++j) { - // col == k and row > col - if (A_col_indices[j] == row && A_row_indices[j] > A_col_indices[j]) { - A_vals[j] /= pivot; - rows_L.push_back(A_row_indices[j]); - vals_L.push_back(A_vals[j]); - } - } - - // Update already existing entries - std::vector add_rows, add_cols, add_index; - std::vector add_vals; - for (std::size_t j = k; j < A_row_indices.size(); ++j) { - if (A_row_indices[j] < row) - throw std::runtime_error("Loop through previous row in Gaussian elimination, should not happen if " - "rows sorted in increasing order in the matrix."); - - // If row == k or col <= k, continue searching - if (A_row_indices[j] == row || A_col_indices[j] <= row) - continue; - - // col not in pivot row (U_ki = 0) or row not in L_k (L_jk = 0), continue searching - auto col_ind = std::find(cols.begin(), cols.end(), A_col_indices[j]); - auto row_ind = std::find(rows_L.begin(), rows_L.end(), A_row_indices[j]); - if (col_ind == cols.end() || row_ind == rows_L.end()) - continue; - // Else, update the row of U with U(j,i) = U(j,i) - L(j,k) * U(k,i) - // i.e. to save storage: A(j,i) = A(j,i) - A(j,k) * A(k,i), j > k - A_vals[j] -= vals_L[row_ind - rows_L.begin()] * vals[col_ind - cols.begin()]; - add_rows.push_back(A_row_indices[j]); - add_cols.push_back(A_col_indices[j]); - add_vals.push_back(A_vals[j]); - } - - // Take fill-in into account: values at the intersection of entries L_jk and U_ki - std::vector add_rows_FI_tot, add_cols_FI_tot; - std::vector add_vals_FI_tot; - for (std::size_t j = 0; j < rows_L.size(); ++j) { - std::vector add_rows_FI, add_cols_FI; - std::vector add_vals_FI; - for (std::size_t i = 0; i < cols.size(); ++i) { - // Only update the upper part of U - if (cols[i] <= row || rows_L[j] <= row) - continue; - - // Check if entry exists: was already updated - int exists = 0; - for (std::size_t k = 0; k < add_rows.size(); k++) - if (add_rows[k] == rows_L[j] && add_cols[k] == cols[i]) { - exists = 1; - break; - } - if (exists) - continue; - - // Else, update the row of U with U(j,i) = U(j,i) - L(j,k) * U(k,i) - // i.e. to save storage: A(j,i) = A(j,i) - A(j,k) * A(k,i), j > k - add_rows_FI.push_back(rows_L[j]); - add_cols_FI.push_back(cols[i]); - add_vals_FI.push_back(-vals_L[j] * vals[i]); - } - A_row_indices.insert(A_row_indices.begin() + A_row_ptr[rows_L[j] + 1], add_rows_FI.begin(), - add_rows_FI.end()); - A_col_indices.insert(A_col_indices.begin() + A_row_ptr[rows_L[j] + 1], add_cols_FI.begin(), - add_cols_FI.end()); - A_vals.insert(A_vals.begin() + A_row_ptr[rows_L[j] + 1], add_vals_FI.begin(), add_vals_FI.end()); - - for (std::size_t r = rows_L[j] + 1; r < A_row_ptr.size(); r++) - A_row_ptr[r] += add_rows_FI.size(); - } - - // New row: - if (k < A_row_indices.size()) { - row = A_row_indices[k]; - // - empty columns/rows and values for pivot row and L_k - cols.clear(); - vals.clear(); - rows_L.clear(); - vals_L.clear(); - // - loop again on this entry - if (k != A_row_indices.size()) - k--; - } - } - // If same row, store the values and col indices - else { - // Do not consider values from L - if (A_col_indices[k] < row) - continue; - if (A_col_indices[k] == row) { - pivot = A_vals[k]; - if (pivot == 0) - throw std::runtime_error("Null pivot found in Gaussian elimination."); - } - cols.push_back(A_col_indices[k]); - vals.push_back(A_vals[k]); - } - } -} /* ----- end of level::facto_gaussian_elimination ----- */ - -/*! - * \brief Solve on a specific RHS using an in-house sparse solver - * - * Solve on a specific RHS using an in-house sparse solver - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param f: the RHS - */ -std::vector level::solve_gaussian_elimination(std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, std::vector f) -{ - // int m_solution = f.size(); - - if (gyro::icntl[Param::verbose] > 3) { - std::cout << "Starting Gaussian elimination forward substitution \n"; - } - // Solve Ly = b for y (Forward Substitution) - // (assumes rows in increasing order) - int row = A_row_indices[0]; - std::vector y(f); - for (std::size_t j = 0; j < A_row_indices.size(); ++j) { - if (A_col_indices[j] >= A_row_indices[j]) - continue; - y[A_row_indices[j]] -= y[A_col_indices[j]] * A_vals[j]; - } - - if (gyro::icntl[Param::verbose] > 3) { - std::cout << "Starting Gaussian elimination backward substitution \n"; - } - //Solve Ux = y for x (Backward Substitution) - row = A_row_indices[A_row_indices.size() - 1]; - int jind; - double U_jj; - std::vector x(y); - for (int j = A_row_indices.size() - 1; j >= -1; --j) { - if (j != -1 && A_col_indices[j] < A_row_indices[j]) - continue; - - // If new row, we can apply the diagonal element of U - if (j == -1 || A_row_indices[j] != row) { - x[row] /= U_jj; - - if (j == -1) - break; - - row = A_row_indices[j]; - } - - if (A_row_indices[j] == A_col_indices[j]) { - U_jj = A_vals[j]; - jind = j; - continue; - } - - x[row] -= x[A_col_indices[j]] * A_vals[j]; - } - - return x; - -} /* ----- end of level::solve_gaussian_elimination ----- */ - -/*! - * \brief Factorization and solve on a specific RHS using an in-house sparse solver (deprecated) - * - * Factorization and solve on a specific RHS using an in-house sparse solver - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param f: the RHS - */ -std::vector level::solve_gaussian_elimination_fb_subst(std::vector A_row_indices, - std::vector A_col_indices, - std::vector A_vals, std::vector f) -{ - //std::cout << "Gaussian Elimination!\n"; - - int m_solution = f.size(); - std::vector x(m_solution, 0.0); //x is the solution vector, it has the same size than f, fill with zeros - - //Gaussian Elimination - //create matrices U and L - //U = A - std::vector U_row_indices(A_row_indices); - std::vector U_col_indices(A_col_indices); - std::vector U_vals(A_vals); - - //L = I - std::vector L_row_indices; //=[0,1,2,3,4...m-1] - std::vector L_col_indices; //=[0,1,2,3,4...m-1] - std::vector L_vals; //=[1,1,1,1...] m-times - for (int i = 0; i < m_solution; ++i) { - L_col_indices.push_back(i); - L_row_indices.push_back(i); - L_vals.push_back(1); - } - - //Gaussian Elimination - for (int k = 0; k < m_solution - 1; ++k) { //k=col index - for (int j = k + 1; j < m_solution; ++j) { //j=row index - - double U_jk = get_element(U_row_indices, U_col_indices, U_vals, j, k); //get the element (j,k) of U - - //if the U_jk is zero, we don't need to treat it and can just go on with the next element - if (U_jk != 0) { - double U_kk = get_element(U_row_indices, U_col_indices, U_vals, k, k); //get the element (k,k) of U - double L_jk = U_jk / U_kk; //step of GE - - //insert the new element L_jk into the matrix L - //as it has to be a new value, which is not yet there, just append new value to the end - L_vals.push_back(L_jk); - L_row_indices.push_back(j); - L_col_indices.push_back(k); - - for (int i = k; i < m_solution; ++i) { - - double U_ki = get_element(U_row_indices, U_col_indices, U_vals, k, i); //get the element (k,i) of U - - if (U_ki != 0) { //we can skip this part, if U_ki=0 - //U(j,i) = U(j,i) - L(j,k) * U(k,i) --> step of GE - double value = get_element(U_row_indices, U_col_indices, U_vals, j, i) - L_jk * U_ki; - set_element(U_row_indices, U_col_indices, U_vals, j, i, value); - } - } - } - } - } - - //std::cout << "backward substitution \n"; - //Forward-Backward-Substitution - - //Solve Ly=b for y (Forward Substitution) - std::vector y(m_solution, 0.0); - for (int j = 0; j < m_solution; ++j) { - - double L_jj = get_element(L_row_indices, L_col_indices, L_vals, j, j); //get the element (j,j) of U - double sum = 0; - - for (int k = 0; k < j; ++k) { - double L_jk = get_element(L_row_indices, L_col_indices, L_vals, j, k); //get the element (j,k) of U - sum += y[k] * L_jk; - } - y[j] = (f[j] - sum) / L_jj; - } - - //Solve Ux=y for x (Backward Substitution) - for (int j = m_solution - 1; j >= 0; --j) { - - double U_jj = get_element(U_row_indices, U_col_indices, U_vals, j, j); //get the element (j,j) of U - double sum = 0; - - for (int k = j; k < m_solution; ++k) { - double U_jk = get_element(U_row_indices, U_col_indices, U_vals, j, k); //get the element (j,k) of U - sum += x[k] * U_jk; - } - x[j] = (y[j] - sum) / U_jj; - } - - return x; -} /* ----- end of level::solve_gaussian_elimination_fb_subst ----- */ - -/*! - * \brief Finds value of entry (row, col) in the sparse matrix (deprecated) - * - * Finds value of entry (row, col) in the sparse matrix - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param row_index: row to find - * \param col_index: col to find - */ -double level::get_element(std::vector A_row_indices, std::vector A_col_indices, std::vector A_vals, - int row_index, int col_index) -{ - //get the element (i,j) of A - double A_ij = 0; - - //second version of code - int min = 0; - int max = A_vals.size(); - int count = log2(A_vals.size() / 10); - - //try to make the search region smaller, values in matrix are sorted by ascending rows - for (int z = 0; z < count; ++z) { - int middle = min + (max - min) / 2; - if (row_index > middle) { - min = middle; - } - else { - max = middle; - } - } - - for (int v = min; v < (int)A_vals.size(); ++v) { - if (A_row_indices[v] == row_index) { - if (A_col_indices[v] == col_index) { - A_ij = A_vals[v]; - break; //break the for loop when we found the value - } - } - } - - return A_ij; -} /* ----- end of level::get_element ----- */ - -/*! - * \brief Sets value of entry (row, col) in the sparse matrix (deprecated) - * - * Sets value of entry (row, col) in the sparse matrix - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param row_index: row to find - * \param col_index: col to find - */ -void level::set_element(std::vector& A_row_indices, std::vector& A_col_indices, std::vector& A_vals, - int row_index, int col_index, double value) -{ - - //set the element (i,j) of A to 'value' - //if there exists already an element, it is overwritten with 'value' - //if the element does not exist yet, just append it to the end - - int min = 0; - int max = A_vals.size(); - int count = log2(A_vals.size() / 10); - - //try to make the search region smaller, values in matrix are sorted by ascending rows - for (int z = 0; z < count; ++z) { - int middle = min + (max - min) / 2; - if (row_index > middle) { - min = middle; - } - else { - max = middle; - } - } - - int existing_element = 0; - for (int v = min; v < (int)A_vals.size(); ++v) { //check if there exists already an element - if (A_row_indices[v] == row_index) { - if (A_col_indices[v] == col_index) { - existing_element = 1; - if (value != 0) { //if value is not zero: set it - A_vals[v] = value; - } - else { //if value is zero: delete element from sparse matrix - A_vals.erase(A_vals.begin() + v); - A_row_indices.erase(A_row_indices.begin() + v); - A_col_indices.erase(A_col_indices.begin() + v); - } - break; //if we found the element, we can break the for-loop - } - } - } - if (existing_element == 0) { //if there exists no element yet, just append it - A_vals.push_back(value); - A_row_indices.push_back(row_index); - A_col_indices.push_back(col_index); - } -} /* ----- end of level::set_element ----- */ - -/*! - * \brief Solve diagonal system on a specific RHS - * - * Solve diagonal system on a specific RHS - * - * \param A_vals: vector of values for the diagonal matrix - * \param f: the RHS - */ -std::vector level::solve_diag(std::vector A_vals, std::vector f) -{ - int m = f.size(); - std::vector x(f); - // #pragma omp parallel for shared(x, A_vals) - for (int i = 0; i < m; i++) { - x[i] /= A_vals[i]; - } - return x; -} /* ----- end of level::solve_gaussian_elimination_fb_subst ----- */ - -/*! - * \brief Solve system for Circle smoother on a specific RHS - * - * Solve system for Circle smoother on a specific RHS - * The size of the system should be > 2 - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param f: the RHS - */ -std::vector level::solve_circle(std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, std::vector f) -{ - int m = f.size(); - std::vector x(f); - - /************************************** - * Forward substitution (Ly=f) - *************************************/ - // interior - for (int i = 0; i < m - 2; i++) { - int ind = 4 * i + 3; - x[i + 1] -= A_vals[ind] * x[i]; - int ind2 = 4 * (m - 3) + 3 + 3; - x[m - 1] -= A_vals[ind2 + i] * x[i]; - } - // Penultian line - int i = m - 2; - int ind2 = 4 * (m - 3) + 3 + 3; - x[m - 1] -= A_vals[ind2 + i] * x[i]; - - /************************************** - * Backward substitution (Ux=y) - *************************************/ - // Last line - int ind = 4 * (m - 3) + 3 + 3; - x[m - 1] /= A_vals[ind + m - 1]; - ind = 4 * (m - 3) + 3; - x[m - 2] -= A_vals[ind + 2] * x[m - 1]; - // Penultian line - i = m - 3; - ind = 4 * i + 3; - x[i + 1] /= A_vals[ind + 1]; - x[i] -= A_vals[ind - 2] * x[i + 1]; - - // Interior - for (int i = m - 4; i >= 0; i--) { - ind = 4 * i + 3; - x[i + 1] -= A_vals[ind + 3] * x[m - 1]; - x[i + 1] /= A_vals[ind + 1]; - x[i] -= A_vals[ind - 2] * x[i + 1]; - } - // first - x[0] -= A_vals[2] * x[m - 1]; - x[0] /= A_vals[0]; - - return x; -} /* ----- end of level::solve_gaussian_elimination_fb_subst ----- */ - -/*! - * \brief Solve system for Circle smoother on a specific RHS - * - * Solve system for Circle smoother on a specific RHS - * The size of the system should be > 2 - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param f: the RHS - */ -std::vector level::solve_radial(std::vector A_row_indices, std::vector A_col_indices, - std::vector A_vals, std::vector f) -{ - int i, ind, m = f.size(); - std::vector x(f); - - /************************************** - * Forward substitution (Ly=f) - *************************************/ - // interior - for (i = 0; i < m - 2; i++) { - ind = 3 * i + 2; - x[i + 1] -= A_vals[ind] * x[i]; - } - - /************************************** - * Backward substitution (Ux=y) - *************************************/ - ind = 3 * (m - 3) + 4; - x[m - 1] /= A_vals[ind]; - for (i = m - 3; i >= 0; i--) { - ind = 3 * i + 2; - x[i + 1] /= A_vals[ind + 1]; - x[i] -= A_vals[ind - 1] * x[i + 1]; - } - // first lines - x[0] /= A_vals[0]; - - return x; -} /* ----- end of level::solve_gaussian_elimination_fb_subst ----- */ - -/*! - * \brief Factorization of A using an in-house sparse solver - * - * Factorization of A using an in-house sparse solver - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param m_solution: size of the solutions in MUMPS - */ -void level::facto_radial(std::vector& A_row_indices, std::vector& A_col_indices, std::vector& A_vals, - int m) - -{ - int i, ind; - - // Interior - for (i = 0; i < m - 2; i++) { - ind = 3 * i + 2; - A_vals[ind] /= A_vals[ind - 2]; // L - A_vals[ind + 1] -= A_vals[ind - 1] * A_vals[ind]; // U - } -} /* ----- end of level::facto_gaussian_elimination ----- */ -/*! - * \brief Factorization of A using an in-house sparse solver - * - * Factorization of A using an in-house sparse solver - * - * \param A_row_indices: vector of row indices for the matrix - * \param A_col_indices: vector of column indices for the matrix - * \param A_vals: vector of valus for the matrix - * \param m_solution: size of the solutions in MUMPS - */ -void level::facto_circle(std::vector& A_row_indices, std::vector& A_col_indices, std::vector& A_vals, - int m) - -{ - int i, ind, ind2; - - // First line - ind = 3; - A_vals[ind] /= A_vals[ind - 3]; // L - A_vals[ind + 1] -= A_vals[ind - 2] * A_vals[ind]; // U (diag) - A_vals[ind + 3] -= A_vals[ind - 1] * A_vals[ind]; // U (last col=fill-in) - // Update last line - ind2 = 4 * (m - 3) + 3 + 3; - A_vals[ind2] /= A_vals[ind - 3]; // L - A_vals[ind2 + 1] -= A_vals[ind - 2] * A_vals[ind2]; // L (last line=fill-in) - A_vals[ind2 + m - 1] -= A_vals[ind - 1] * A_vals[ind2]; // U (diag) - // Interior - for (i = 1; i < m - 3; i++) { - ind = 4 * i + 3; - A_vals[ind] /= A_vals[ind - 3]; // L - A_vals[ind + 1] -= A_vals[ind - 2] * A_vals[ind]; // U (diag) - A_vals[ind + 3] -= A_vals[ind - 1] * A_vals[ind]; // U (last col=fill-in) - // Update last line - ind2 = 4 * (m - 3) + 3 + 3; - A_vals[ind2 + i] /= A_vals[ind - 3]; // L - A_vals[ind2 + i + 1] -= A_vals[ind - 2] * A_vals[ind2 + i]; // L (last line=fill-in) - A_vals[ind2 + m - 1] -= A_vals[ind - 1] * A_vals[ind2 + i]; // U (diag) - } - // Penultian line - i = (m - 3); - ind = 4 * i + 3; - A_vals[ind] /= A_vals[ind - 3]; // L - A_vals[ind + 1] -= A_vals[ind - 2] * A_vals[ind]; // U (diag) - A_vals[ind + 2] -= A_vals[ind - 1] * A_vals[ind]; // U (last col) - // Update last line - ind2 = 4 * (m - 3) + 3 + 3; - A_vals[ind2 + i] /= A_vals[ind - 3]; // L - A_vals[ind2 + i + 1] -= A_vals[ind - 2] * A_vals[ind2 + i]; // U (diag) - A_vals[ind2 + m - 1] -= A_vals[ind - 1] * A_vals[ind2 + i]; // U (last col) - // Last line - A_vals[ind2 + m - 2] /= A_vals[ind + 1]; // L - A_vals[ind2 + m - 1] -= A_vals[ind + 2] * A_vals[ind2 + m - 2]; // L -} /* ----- end of level::facto_gaussian_elimination ----- */ - -/*! - * \brief Initialize the LU factors for circle - * - * Initialize the LU factors for the circle smoother based on the matrix - * while taking into account the fill-in. - * - * \param ij: block number for the current smoother - * \param smoother: the current smoother - * - */ -void level::fill_in_circle(int ij, int smoother) -{ - int ind, ind2; - int msc = m_sc[smoother]; - int size_LU = 3 * msc + 2 * (msc - 3); - // first line - A_Zebra_r_LU_row[smoother][ij] = std::vector(size_LU); - A_Zebra_c_LU_row[smoother][ij] = std::vector(size_LU); - A_Zebra_v_LU_row[smoother][ij] = std::vector(size_LU); - A_Zebra_r_LU_row[smoother][ij][0] = A_Zebra_r_row[smoother][ij][1]; - A_Zebra_c_LU_row[smoother][ij][0] = A_Zebra_c_row[smoother][ij][1]; - A_Zebra_v_LU_row[smoother][ij][0] = A_Zebra_v_row[smoother][ij][1]; - A_Zebra_r_LU_row[smoother][ij][1] = A_Zebra_r_row[smoother][ij][2]; - A_Zebra_c_LU_row[smoother][ij][1] = A_Zebra_c_row[smoother][ij][2]; - A_Zebra_v_LU_row[smoother][ij][1] = A_Zebra_v_row[smoother][ij][2]; - A_Zebra_r_LU_row[smoother][ij][2] = A_Zebra_r_row[smoother][ij][0]; - A_Zebra_c_LU_row[smoother][ij][2] = A_Zebra_c_row[smoother][ij][0]; - A_Zebra_v_LU_row[smoother][ij][2] = A_Zebra_v_row[smoother][ij][0]; - // interior - for (int i = 0; i < msc - 2; i++) { - ind = 3 * i + 3; - ind2 = 4 * i + 3; - - A_Zebra_r_LU_row[smoother][ij][ind2] = A_Zebra_r_row[smoother][ij][ind]; - A_Zebra_r_LU_row[smoother][ij][ind2 + 1] = A_Zebra_r_row[smoother][ij][ind + 1]; - A_Zebra_r_LU_row[smoother][ij][ind2 + 2] = A_Zebra_r_row[smoother][ij][ind + 2]; - A_Zebra_r_LU_row[smoother][ij][ind2 + 3] = A_Zebra_r_row[smoother][ij][ind + 2]; - A_Zebra_c_LU_row[smoother][ij][ind2] = A_Zebra_c_row[smoother][ij][ind]; - A_Zebra_c_LU_row[smoother][ij][ind2 + 1] = A_Zebra_c_row[smoother][ij][ind + 1]; - A_Zebra_c_LU_row[smoother][ij][ind2 + 2] = A_Zebra_c_row[smoother][ij][ind + 2]; - A_Zebra_c_LU_row[smoother][ij][ind2 + 3] = msc - 1; - A_Zebra_v_LU_row[smoother][ij][ind2] = A_Zebra_v_row[smoother][ij][ind]; - A_Zebra_v_LU_row[smoother][ij][ind2 + 1] = A_Zebra_v_row[smoother][ij][ind + 1]; - A_Zebra_v_LU_row[smoother][ij][ind2 + 2] = A_Zebra_v_row[smoother][ij][ind + 2]; - A_Zebra_v_LU_row[smoother][ij][ind2 + 3] = 0; - } - // Penultian line - ind = 3 * (msc - 3) + 3; - ind2 = 4 * (msc - 3) + 3; - A_Zebra_r_LU_row[smoother][ij][ind2] = A_Zebra_r_row[smoother][ij][ind]; - A_Zebra_r_LU_row[smoother][ij][ind2 + 1] = A_Zebra_r_row[smoother][ij][ind + 1]; - A_Zebra_r_LU_row[smoother][ij][ind2 + 2] = A_Zebra_r_row[smoother][ij][ind + 2]; - A_Zebra_c_LU_row[smoother][ij][ind2] = A_Zebra_c_row[smoother][ij][ind]; - A_Zebra_c_LU_row[smoother][ij][ind2 + 1] = A_Zebra_c_row[smoother][ij][ind + 1]; - A_Zebra_c_LU_row[smoother][ij][ind2 + 2] = A_Zebra_c_row[smoother][ij][ind + 2]; - A_Zebra_v_LU_row[smoother][ij][ind2] = A_Zebra_v_row[smoother][ij][ind]; - A_Zebra_v_LU_row[smoother][ij][ind2 + 1] = A_Zebra_v_row[smoother][ij][ind + 1]; - A_Zebra_v_LU_row[smoother][ij][ind2 + 2] = A_Zebra_v_row[smoother][ij][ind + 2]; - // last line - ind = 3 * (msc - 3) + 3 + 3; - ind2 = 4 * (msc - 3) + 3 + 3; - A_Zebra_r_LU_row[smoother][ij][ind2] = A_Zebra_r_row[smoother][ij][ind + 2]; - A_Zebra_c_LU_row[smoother][ij][ind2] = A_Zebra_c_row[smoother][ij][ind + 2]; - A_Zebra_v_LU_row[smoother][ij][ind2] = A_Zebra_v_row[smoother][ij][ind + 2]; - for (int i = 1; i < msc - 2; i++) { - A_Zebra_r_LU_row[smoother][ij][ind2 + i] = msc - 1; - A_Zebra_c_LU_row[smoother][ij][ind2 + i] = i; - A_Zebra_v_LU_row[smoother][ij][ind2 + i] = 0; - } - A_Zebra_r_LU_row[smoother][ij][ind2 + msc - 2] = A_Zebra_r_row[smoother][ij][ind]; - A_Zebra_c_LU_row[smoother][ij][ind2 + msc - 2] = A_Zebra_c_row[smoother][ij][ind]; - A_Zebra_v_LU_row[smoother][ij][ind2 + msc - 2] = A_Zebra_v_row[smoother][ij][ind]; - A_Zebra_r_LU_row[smoother][ij][ind2 + msc - 1] = A_Zebra_r_row[smoother][ij][ind + 1]; - A_Zebra_c_LU_row[smoother][ij][ind2 + msc - 1] = A_Zebra_c_row[smoother][ij][ind + 1]; - A_Zebra_v_LU_row[smoother][ij][ind2 + msc - 1] = A_Zebra_v_row[smoother][ij][ind + 1]; -} /* ----- end of level::fill_in_circle ----- */ diff --git a/src/gmgpolar.cpp b/src/gmgpolar.cpp deleted file mode 100644 index dea7adc1..00000000 --- a/src/gmgpolar.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file gmgpolar.cpp - * \brief Implementation of the class gmgpolar - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gmgpolar.h" - -/*! - * \brief Default Constructor of gmgpolar class - * - * Default constructor of the gmgpolar class, sets default values for - * attributes. - * - */ -gmgpolar::gmgpolar() -{ - reset_timers(); -} /* ----- end of constructor gmgpolar:gmgpolar ----- */ - -/*! - * \brief Default Destructor of gmgpolar class - * - * Default destructor of the gmgpolar class. - * - */ -gmgpolar::~gmgpolar() -{ - for (int i = 0; i < levels_orig; i++) { - delete v_level[i]; - } -} /* ----- end of destructor gmgpolar::~gmgpolar ----- */ - -/*! - * \brief Sets execution times to 0 - * - * Sets execution times to 0. - * - */ -void gmgpolar::reset_timers() -{ - t_setup = 0; - t_build = 0; - t_facto_Ac = 0; - t_build_P = 0; - t_build_Asc = 0; - t_facto_Asc = 0; - t_total_mgcycle = 0; - t_smoothing = 0; - t_residual = 0; - t_restriction = 0; - t_Ac = 0; - t_prolongation = 0; - t_applyA = 0; - t_fine_residual = 0; - t_error = 0; -} /* ----- end of gmgpolar::reset_timers ----- */ diff --git a/src/gyro.cpp b/src/gyro.cpp deleted file mode 100644 index d70ec556..00000000 --- a/src/gyro.cpp +++ /dev/null @@ -1,1586 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file gyro.cpp - * \brief Header for the class gyro - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gyro.h" -#include "CartesianR2GyroSonnendruckerCircular.h" -#include "CartesianR2GyroSonnendruckerShafranov.h" -#include "CartesianR2GyroSonnendruckerTriangular.h" -#include "PolarR6GyroSonnendruckerCircular.h" -#include "PolarR6GyroSonnendruckerShafranov.h" -#include "PolarR6GyroSonnendruckerTriangular.h" -#include "CartesianR6GyroSonnendruckerCircular.h" -#include "CartesianR6GyroSonnendruckerShafranov.h" -#include "CartesianR6GyroSonnendruckerTriangular.h" -#include "CartesianR2GyroZoniCircular.h" -#include "CartesianR2GyroZoniShafranov.h" -#include "CartesianR2GyroZoniTriangular.h" -#include "PolarR6GyroZoniCircular.h" -#include "PolarR6GyroZoniShafranov.h" -#include "PolarR6GyroZoniTriangular.h" -#include "CartesianR6GyroZoniCircular.h" -#include "CartesianR6GyroZoniShafranov.h" -#include "CartesianR6GyroZoniTriangular.h" -#include "CartesianR2GyroZoniShiftedCircular.h" -#include "CartesianR2GyroZoniShiftedShafranov.h" -#include "CartesianR2GyroZoniShiftedTriangular.h" -#include "PolarR6GyroZoniShiftedCircular.h" -#include "PolarR6GyroZoniShiftedShafranov.h" -#include "PolarR6GyroZoniShiftedTriangular.h" -#include "PolarR6GyroZoniShiftedCulham.h" -#include "CartesianR6GyroZoniShiftedCircular.h" -#include "CartesianR6GyroZoniShiftedShafranov.h" -#include "CartesianR6GyroZoniShiftedTriangular.h" -#include "CartesianR2SonnendruckerCircular.h" -#include "CartesianR2SonnendruckerShafranov.h" -#include "CartesianR2SonnendruckerTriangular.h" -#include "PolarR6SonnendruckerCircular.h" -#include "PolarR6SonnendruckerShafranov.h" -#include "PolarR6SonnendruckerTriangular.h" -#include "CartesianR6SonnendruckerCircular.h" -#include "CartesianR6SonnendruckerShafranov.h" -#include "CartesianR6SonnendruckerTriangular.h" -#include "CartesianR2ZoniCircular.h" -#include "CartesianR2ZoniShafranov.h" -#include "CartesianR2ZoniTriangular.h" -#include "PolarR6ZoniCircular.h" -#include "PolarR6ZoniShafranov.h" -#include "PolarR6ZoniTriangular.h" -#include "CartesianR6ZoniCircular.h" -#include "CartesianR6ZoniShafranov.h" -#include "CartesianR6ZoniTriangular.h" -#include "CartesianR2ZoniShiftedCircular.h" -#include "CartesianR2ZoniShiftedShafranov.h" -#include "CartesianR2ZoniShiftedTriangular.h" -#include "PolarR6ZoniShiftedCircular.h" -#include "PolarR6ZoniShiftedShafranov.h" -#include "PolarR6ZoniShiftedTriangular.h" -#include "CartesianR6ZoniShiftedCircular.h" -#include "CartesianR6ZoniShiftedShafranov.h" -#include "CartesianR6ZoniShiftedTriangular.h" -#include "CartesianR2PoissonCircular.h" -#include "CartesianR2PoissonShafranov.h" -#include "CartesianR2PoissonTriangular.h" -#include "PolarR6PoissonCircular.h" -#include "PolarR6PoissonShafranov.h" -#include "PolarR6PoissonTriangular.h" -#include "CartesianR6PoissonCircular.h" -#include "CartesianR6PoissonShafranov.h" -#include "CartesianR6PoissonTriangular.h" -#include "RefinedGyroZoniShiftedCircular.h" -#include "RefinedGyroZoniShiftedShafranov.h" -#include "RefinedGyroZoniShiftedTriangular.h" -#include "RefinedGyroZoniShiftedCulham.h" - -namespace gyro -{ -/******************************************************************************* - * Attributes - ******************************************************************************/ -/*************************************************************************** - * Controls and Informations - **************************************************************************/ -/* controls initialization */ -std::vector icntl(40, 0); -std::vector dcntl(30, 0); - -/* infos initialization */ -std::vector info(10, 0); -std::vector dinfo(10, 0); -std::unique_ptr functions; - -std::string f_grid_r = ""; -std::string f_grid_theta = ""; -std::string f_sol_in = ""; -std::string f_sol_out = ""; -} // namespace gyro - -/******************************************************************************* - * Methods - ******************************************************************************/ -/*************************************************************************** - * Parameters - **************************************************************************/ -/*! - * \brief Initialize the chosen parameters - * - * Initialize the chosen parameters - * - */ -void gyro::init_params() -{ - icntl[Param::optimized] = 1; - icntl[Param::matrix_free] = 1; - icntl[Param::debug] = 0; - icntl[Param::nr_exp] = 3; - icntl[Param::ntheta_exp] = 3; - icntl[Param::fac_ani] = 0; // 0 or 1 - icntl[Param::v1] = 1; - icntl[Param::v2] = 1; - icntl[Param::cycle] = 1; // 1 or 2 - icntl[Param::mod_pk] = 0; // 0 or 1 - icntl[Param::compute_rho] = 0; // 0 or 1 - icntl[Param::level] = -1; - icntl[Param::plotit] = 1; - icntl[Param::solveit] = 1; - icntl[Param::maxiter] = 150; - icntl[Param::periodic] = 1; - icntl[Param::origin_NOT_coarse] = 0; - icntl[Param::theta_aniso] = 0; - icntl[Param::smoother] = 3; // originally 4 intended (optimized) - icntl[Param::discr] = 3; - icntl[Param::extrapolation] = 2; - icntl[Param::DirBC_Interior] = 0; // 0 or 1 - icntl[Param::paraview] = 0; - icntl[Param::divideBy2] = 0; - icntl[Param::prob] = 5; - icntl[Param::alpha_coeff] = 0; - icntl[Param::beta_coeff] = 0; - icntl[Param::verbose] = 2; - icntl[Param::openmp] = 1; - icntl[Param::res_norm] = 3; - icntl[Param::write_radii_angles] = 0; - icntl[Param::check_error] = 0; - - dcntl[Param::r0_DB] = -1e6; - dcntl[Param::R0] = 0.1; - dcntl[Param::R] = 1.3; - dcntl[Param::THETA0] = 0.1; - dcntl[Param::THETA] = 1.3; - dcntl[Param::kappa_eps] = 0; - dcntl[Param::delta_e] = 0; - dcntl[Param::tol_bound_check] = 1e-8; - dcntl[Param::rel_red_conv] = 1e-8; - dcntl[Param::t_coeff] = 0; - dcntl[Param::t_arr_art_att] = 0; - dcntl[Param::t_sol] = 0; - dcntl[Param::t_detDFinv] = 0; - dcntl[Param::t_trafo] = 0; -} /* ----- end of gyro::init_params ----- */ - -/*! - * \brief Shows the chosen parameters - * - * Shows the chosen parameters - * - */ -void gyro::show_params() -{ - std::cout << "optimized: " << icntl[Param::optimized] << "\n"; - std::cout << "matrix_free: " << icntl[Param::matrix_free] << "\n"; - std::cout << "debug: " << icntl[Param::debug] << "\n"; - std::cout << "nr_exp: " << icntl[Param::nr_exp] << "\n"; - std::cout << "ntheta_exp: " << icntl[Param::ntheta_exp] << "\n"; - std::cout << "fac_ani: " << icntl[Param::fac_ani] << "\n"; - std::cout << "theta_aniso: " << icntl[Param::theta_aniso] << "\n"; - std::cout << "v1: " << icntl[Param::v1] << "\n"; - std::cout << "v2: " << icntl[Param::v2] << "\n"; - std::cout << "cycle: " << icntl[Param::cycle] << "\n"; - std::cout << "mod_pk: " << icntl[Param::mod_pk] << "\n"; - std::cout << "compute_rho: " << icntl[Param::compute_rho] << "\n"; - std::cout << "level: " << icntl[Param::level] << "\n"; - std::cout << "plotit: " << icntl[Param::plotit] << "\n"; - std::cout << "solveit: " << icntl[Param::solveit] << "\n"; - std::cout << "maxiter: " << icntl[Param::maxiter] << "\n"; - std::cout << "periodic: " << icntl[Param::periodic] << "\n"; - std::cout << "origin_NOT_coarse: " << icntl[Param::origin_NOT_coarse] << "\n"; - std::cout << "smoother: " << icntl[Param::smoother] << "\n"; - std::cout << "discr: " << icntl[Param::discr] << "\n"; - std::cout << "extrapolation: " << icntl[Param::extrapolation] << "\n"; - std::cout << "DirBC_Interior: " << icntl[Param::DirBC_Interior] << "\n"; - std::cout << "paraview: " << icntl[Param::paraview] << "\n"; - std::cout << "divideBy2: " << icntl[Param::divideBy2] << "\n"; - std::cout << "prob: " << icntl[Param::prob] << "\n"; - std::cout << "alpha_coeff: " << icntl[Param::alpha_coeff] << "\n"; - std::cout << "beta_coeff: " << icntl[Param::beta_coeff] << "\n"; - std::cout << "verbose: " << icntl[Param::verbose] << "\n"; - std::cout << "openmp: " << icntl[Param::openmp] << "\n"; - std::cout << "res_norm: " << icntl[Param::res_norm] << "\n"; - std::cout << "write_radii_angles: " << icntl[Param::write_radii_angles] << "\n"; - std::cout << "check_error: " << icntl[Param::check_error] << "\n"; - - std::cout << "R0: " << dcntl[Param::R0] << "\n"; - std::cout << "R: " << dcntl[Param::R] << "\n"; - std::cout << "kappa_eps: " << dcntl[Param::kappa_eps] << "\n"; - std::cout << "delta_e: " << dcntl[Param::delta_e] << "\n"; - std::cout << "tol_bound_check: " << dcntl[Param::tol_bound_check] << "\n"; - std::cout << "rel_red_conv: " << dcntl[Param::rel_red_conv] << "\n"; - std::cout << "\n"; -} /* ----- end of gyro::show_params ----- */ - -/*************************************************************************** - * Boundary and solution - **************************************************************************/ -/************************ - * Single - ************************/ -/*! - * \brief Computes the distance of a node (r, theta) to the Dirichlet boundary. - * The function assumes a boundary given by r_0=Param::r0_DB and R=Param::R. - * - * Attention: As we compute (r-r_0)*(r-R), the output of this function is highly dependent on r_0. - * If r_0 is set "very close" to zero, roundoff errors can appear for function values on the innermost circles. - * However, as dcntl[Param::r0_DB] is advised to be chosen small if icntl[Param::DirBC_Interior]=0 is set, - * this function should be handled with care. Modestly small values like 1e-5 or 1e-8 should not create a problem. - * - * For more details on the Across-The-Origin heuristic, which is implemented with icntl[Param::DirBC_Interior]=0, - * see Kühn, Kruse, Rüde, Journal of Scientific Computing, 91 (28), (2022). - * - * \param r_i: the r coordinate of the node - * \param theta_j: the theta coordinate of the node - * \param verbose: verbose level for debug - * - * \return the distance - * - */ -double gyro::distBoundary(double r_i, double theta_j, int verbose) -{ - // // alt: rectangle/periodic - // double r_i, theta_j; - // gyro::trafo_back(r_i, theta_j, x, y, 0); - // x = r_i; - // y = theta_j; - - double boundDefDim1 = fabs(r_i - dcntl[Param::r0_DB]) * fabs(r_i - dcntl[Param::R]); - double boundDefDim2 = 1; - - if (verbose > 5) { - std::cout << "DISTBOUNDARY (" << r_i << ", " << theta_j << "): " << boundDefDim1 * boundDefDim2 - << " (boundDefDim1: " << boundDefDim1 << ", boundDefDim2: " << boundDefDim2 << ")\n"; - } - return boundDefDim1 * boundDefDim2; -} /* ----- end of gyro::distBoundary ----- */ - -/*! - * \brief Sign function - * - * Sign function returns -1 (< 0) or 1 (>= 0) - * - * \param n: number which sign is to compute - * - * \return the sign - * - */ -int gyro::sign(double n) -{ - return (n < 0) ? -1 : 1; -} - -/*! - * \brief Evaluates the solution - * - * Evaluates the solution from the polar coordinates - * - * \param r_i: the r coordinate of the node - * \param theta_j: the theta coordinate of the node - * \param verbose: verbose level for debug - * - * \return the solution value - * - */ -double gyro::def_solution_rt(double r_i, double theta_j, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double sol = functions->phi_exact(r_i, theta_j, kappa_eps, delta_e, Rmax); - - dcntl[Param::t_sol] += TOC; - - if (verbose > 5) { - std::cout << "SOL (" << r_i << ", " << theta_j << "): " << sol << "\n"; - } - return sol; -} /* ----- end of gyro::eval_def_solution_vec ----- */ - -/************************ - * Vector - ************************/ -/*! - * \brief Evaluates the solution - * - * Evaluates the solution from the r coordinate on all theta positions - * - * \param r_i: the r coordinate of the node - * \param theta: vector theta (0, ntheta_int) - * \param sin_theta: sines of theta - * \param cos_theta: cosines of theta - * \param ntheta: number of values in theta - * \param verbose: verbose level for debug - * - * \return the solution vector - */ -std::vector gyro::def_solution_rt(double r_i, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - // double R0 = dcntl[Param::R0]; - - std::vector sol(ntheta); - functions->phi_exact(r_i, theta, kappa_eps, delta_e, Rmax, sol, sin_theta, cos_theta); - - dcntl[Param::t_sol] += TOC; - - if (verbose > 5) { - for (int i = 0; i < ntheta; i++) - std::cout << "SOL (" << r_i << ", " << theta[i] << "): " << sol[i] << "\n"; - } - return sol; -} /* ----- end of gyro::eval_def_solution_vec ----- */ - -/*************************************************************************** -* Diffusivity and operator -**************************************************************************/ -/*! - * \brief Diffusivity coefficient - * - * Computes the diffusivity coefficient depending on the radius r - * - for prob 3 or 5: alpha(r)=(2.0/(2.6+3.14)) * (1.3 + atan((1-1.3*r/Rmax) / 0.09)) - * - else: 1 - * - * \param r: the r coordinate - * \param verbose: verbose level for debug - * - * \return the coefficient - * - */ -double gyro::coeff_alpha(double r, int verbose) -{ - double t; - TIC; - - double Rmax = dcntl[Param::R]; - - double coeff_a = functions->coeffs1(r, Rmax); - - dcntl[Param::t_coeff] += TOC; - - if (verbose > 5) { - std::cout << "COEFF_A (" << r << "): " << coeff_a << "\n"; - } - return coeff_a; -} /* ----- end of level::coeff ----- */ - -/*! - * \brief Beta coefficient - * - * \param r: the r coordinate - * \param verbose: verbose level for debug - * - * \return the coefficient - * - */ -double gyro::coeff_beta(double r, int verbose) -{ - double t; - TIC; - - double Rmax = dcntl[Param::R]; - - double coeff_b = functions->coeffs2(r, Rmax); - - dcntl[Param::t_coeff] += TOC; - - if (verbose > 5) { - std::cout << "COEFF_B (" << r << "): " << coeff_b << "\n"; - } - return coeff_b; -} /* ----- end of level::coeff ----- */ - -/*! - * \brief Diffusivity coefficient - * - * Computes the diffusivity coefficient depending on the radius r - * - for prob 3 or 5: alpha(r)=(2.0/(2.6+3.14)) * (1.3 + atan((1-1.3*r/Rmax) / 0.09)) - * - else: 1 - * - * \param r: the r coordinate - * \param verbose: verbose level for debug - * - * \return the coefficient - * - */ -std::vector gyro::coeff_alpha(std::vector r, int verbose) -{ - double t; - TIC; - - double Rmax = dcntl[Param::R]; - - std::vector coeff_a(r.size()); - functions->coeffs1(r, Rmax, coeff_a); - - dcntl[Param::t_coeff] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(r, "r"); - disp(coeff_a, "coeff_a"); - } - return coeff_a; -} /* ----- end of level::coeff ----- */ - -/*! - * \brief Beta coefficient - * - * \param r: the r coordinate - * \param verbose: verbose level for debug - * - * \return the coefficient - * - */ -std::vector gyro::coeff_beta(std::vector r, int verbose) -{ - double t; - TIC; - - double Rmax = dcntl[Param::R]; - - std::vector coeff_b(r.size()); - functions->coeffs2(r, Rmax, coeff_b); - - dcntl[Param::t_coeff] += TOC; - if (gyro::icntl[Param::verbose] > 5) { - disp(r, "r"); - disp(coeff_b, "coeff_b"); - } - return coeff_b; -} /* ----- end of level::coeff_beta ----- */ - -/*! - * \brief detDFinv/arr/art/att/arr_att_art (single) - * - * Computes values from the polar coordinates - * - computing the determinant of the derivative of F_inverse (det(DFinv)) - * - computing the coefficient a_r,r - * - computing the coefficient a_r,theta - * - computing the coefficient a_theta,theta - * - computing all 3 coefficients at once to reduce flops - * - * \param r: the r coordinate of the node - * \param theta: the theta coordinate of the node - * \param verbose: verbose level for debug - * - * \return the computed value - * - */ -double gyro::detDFinv(double r, double theta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double Jrr = functions->J_rr(r, theta, kappa_eps, delta_e, Rmax); - double Jrt = functions->J_rt(r, theta, kappa_eps, delta_e, Rmax); - double Jtr = functions->J_tr(r, theta, kappa_eps, delta_e, Rmax); - double Jtt = functions->J_tt(r, theta, kappa_eps, delta_e, Rmax); - double detDFinv_r = Jrr * Jtt - Jrt * Jtr; - - dcntl[Param::t_detDFinv] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - std::cout << "Value of detDFinv (" << r << ", " << theta << "): " << detDFinv_r << "\n"; - } - return detDFinv_r; -} /* ----- end of level::detDFinv ----- */ - -double gyro::arr(double r, double theta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double detDFinv_r = detDFinv(r, theta, verbose); - double coeff_r = coeff_alpha(r, verbose); - double Jrt = functions->J_rt(r, theta, kappa_eps, delta_e, Rmax); - double Jtt = functions->J_tt(r, theta, kappa_eps, delta_e, Rmax); - double arr_r = 0.5 * (Jtt * Jtt + Jrt * Jrt) * coeff_r / fabs(detDFinv_r); - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - std::cout << "Value of arr (" << r << ", " << theta << "): " << arr_r << "\n"; - } - return arr_r; -} /* ----- end of level::arr ----- */ - -double gyro::art(double r, double theta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double detDFinv_r = detDFinv(r, theta, verbose); - double coeff_r = coeff_alpha(r, verbose); - double Jrr = functions->J_rr(r, theta, kappa_eps, delta_e, Rmax); - double Jrt = functions->J_rt(r, theta, kappa_eps, delta_e, Rmax); - double Jtr = functions->J_tr(r, theta, kappa_eps, delta_e, Rmax); - double Jtt = functions->J_tt(r, theta, kappa_eps, delta_e, Rmax); - double art_r = -0.25 * (Jtt * Jtr + Jrt * Jrr) * coeff_r / fabs(detDFinv_r); - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - std::cout << "Value of art (" << r << ", " << theta << "): " << art_r << "\n"; - } - return art_r; -} /* ----- end of level::art ----- */ - -double gyro::att(double r, double theta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double detDFinv_r = detDFinv(r, theta, verbose); - double coeff_r = coeff_alpha(r, verbose); - double Jrr = functions->J_rr(r, theta, kappa_eps, delta_e, Rmax); - double Jtr = functions->J_tr(r, theta, kappa_eps, delta_e, Rmax); - double att_r = 0.5 * (Jtr * Jtr + Jrr * Jrr) * coeff_r / fabs(detDFinv_r); - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - std::cout << "Value of att (" << r << ", " << theta << "): " << att_r << "\n"; - } - return att_r; -} /* ----- end of level::att ----- */ - -void gyro::arr_att_art(double r, double theta, double& arr, double& att, double& art, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - double detDFinv_r = detDFinv(r, theta, verbose); - double coeff_r = coeff_alpha(r, verbose); - double Jrr = functions->J_rr(r, theta, kappa_eps, delta_e, Rmax); - double Jrt = functions->J_rt(r, theta, kappa_eps, delta_e, Rmax); - double Jtr = functions->J_tr(r, theta, kappa_eps, delta_e, Rmax); - double Jtt = functions->J_tt(r, theta, kappa_eps, delta_e, Rmax); - double coeff = coeff_r / fabs(detDFinv_r); - arr = 0.5 * (Jtt * Jtt + Jrt * Jrt) * coeff; - art = -0.25 * (Jtt * Jtr + Jrt * Jrr) * coeff; - att = 0.5 * (Jtr * Jtr + Jrr * Jrr) * coeff; - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - std::cout << "Value of arr (" << r << ", " << theta << "): " << arr << "\n"; - std::cout << "Value of att (" << r << ", " << theta << "): " << att << "\n"; - std::cout << "Value of art (" << r << ", " << theta << "): " << art << "\n"; - } -} /* ----- end of level::arr_att_art ----- */ - -/*! - * \brief detDFinv/arr/art/att/arr_att_art (vector) - * - * Computes values from the r coordinate on all theta positions - * - computing the determinant of the derivative of F_inverse (det(DFinv)) - * - computing the coefficient a_r,r - * - computing the coefficient a_r,theta - * - computing the coefficient a_theta,theta - * - computing all 3 coefficients at once to reduce flops - * - * \param r: the r coordinate of the node - * \param theta: the theta coordinate of the node - * \param verbose: verbose level for debug - * - * \return the computed vector - * - */ -std::vector gyro::detDFinv(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - std::vector detDFinv_r(ntheta); - std::vector Jrr(ntheta); - std::vector Jrt(ntheta); - std::vector Jtr(ntheta); - std::vector Jtt(ntheta); - functions->J_rr(r, theta, kappa_eps, delta_e, Rmax, Jrr, sin_theta, cos_theta); - functions->J_rt(r, theta, kappa_eps, delta_e, Rmax, Jrt, sin_theta, cos_theta); - functions->J_tr(r, theta, kappa_eps, delta_e, Rmax, Jtr, sin_theta, cos_theta); - functions->J_tt(r, theta, kappa_eps, delta_e, Rmax, Jtt, sin_theta, cos_theta); - for (int i = 0; i < ntheta; i++) { - detDFinv_r[i] = Jrr[i] * Jtt[i] - Jrt[i] * Jtr[i]; - } - - dcntl[Param::t_detDFinv] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(theta, "theta"); - disp(cos_theta, "cos_theta"); - disp(detDFinv_r, "detDFinv_r"); - } - return detDFinv_r; -} /* ----- end of level::detDFinv ----- */ - -/*! - * \brief detDFinv/arr/art/att/arr_att_art (vector) - * - * Computes values from the r coordinate on all theta positions - * - computing the determinant of the derivative of F_inverse (det(DFinv)) - * - computing the coefficient a_r,r - * - computing the coefficient a_r,theta - * - computing the coefficient a_theta,theta - * - computing all 3 coefficients at once to reduce flops - * - * \param r: the r coordinate of the node - * \param theta: the theta coordinate of the node - * \param verbose: verbose level for debug - * - * \return the computed vector - * - */ -std::vector gyro::detDFinv(std::vector r, double theta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - std::size_t nr = r.size(); - std::vector detDFinv_r(nr); - std::vector Jrr(nr); - std::vector Jrt(nr); - std::vector Jtr(nr); - std::vector Jtt(nr); - functions->J_rr(r, theta, kappa_eps, delta_e, Rmax, Jrr); - functions->J_rt(r, theta, kappa_eps, delta_e, Rmax, Jrt); - functions->J_tr(r, theta, kappa_eps, delta_e, Rmax, Jtr); - functions->J_tt(r, theta, kappa_eps, delta_e, Rmax, Jtt); - for (std::size_t i = 0; i < r.size(); i++) { - detDFinv_r[i] = Jrr[i] * Jtt[i] - Jrt[i] * Jtr[i]; - } - - dcntl[Param::t_detDFinv] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(r, "r"); - disp(detDFinv_r, "detDFinv_r"); - } - return detDFinv_r; -} /* ----- end of level::detDFinv ----- */ - -std::vector gyro::arr(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - std::vector arr_r(ntheta); - std::vector detDFinv_r = detDFinv(r, theta, sin_theta, cos_theta, ntheta, verbose); - std::vector Jrt(ntheta); - std::vector Jtt(ntheta); - functions->J_rt(r, theta, kappa_eps, delta_e, Rmax, Jrt, sin_theta, cos_theta); - functions->J_tt(r, theta, kappa_eps, delta_e, Rmax, Jtt, sin_theta, cos_theta); - double coeff_r = coeff_alpha(r, verbose); - ; - for (int i = 0; i < ntheta; i++) { - arr_r[i] = 0.5 * (Jtt[i] * Jtt[i] + Jrt[i] * Jrt[i]) * coeff_r / fabs(detDFinv_r[i]); - } - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(theta, "theta"); - disp(sin_theta, "sin_theta"); - disp(cos_theta, "cos_theta"); - disp(arr_r, "arr_r"); - } - return arr_r; -} /* ----- end of level::arr ----- */ -std::vector gyro::art(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - std::vector art_r(ntheta); - std::vector detDFinv_r = detDFinv(r, theta, sin_theta, cos_theta, ntheta, verbose); - std::vector Jrr(ntheta); - std::vector Jrt(ntheta); - std::vector Jtr(ntheta); - std::vector Jtt(ntheta); - functions->J_rr(r, theta, kappa_eps, delta_e, Rmax, Jrr, sin_theta, cos_theta); - functions->J_rt(r, theta, kappa_eps, delta_e, Rmax, Jrt, sin_theta, cos_theta); - functions->J_tr(r, theta, kappa_eps, delta_e, Rmax, Jtr, sin_theta, cos_theta); - functions->J_tt(r, theta, kappa_eps, delta_e, Rmax, Jtt, sin_theta, cos_theta); - double coeff_r = coeff_alpha(r, verbose); - ; - for (int i = 0; i < ntheta; i++) { - art_r[i] = -0.25 * (Jtt[i] * Jtr[i] + Jrt[i] * Jrr[i]) * coeff_r / fabs(detDFinv_r[i]); - } - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(theta, "theta"); - disp(sin_theta, "sin_theta"); - disp(cos_theta, "cos_theta"); - disp(art_r, "art_r"); - } - return art_r; -} /* ----- end of level::art ----- */ -std::vector gyro::att(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - std::vector att_r(ntheta); - std::vector detDFinv_r = detDFinv(r, theta, sin_theta, cos_theta, ntheta, verbose); - std::vector Jrr(ntheta); - std::vector Jrt(ntheta); - std::vector Jtr(ntheta); - std::vector Jtt(ntheta); - functions->J_rr(r, theta, kappa_eps, delta_e, Rmax, Jrr, sin_theta, cos_theta); - functions->J_tr(r, theta, kappa_eps, delta_e, Rmax, Jtr, sin_theta, cos_theta); - double coeff_r = coeff_alpha(r, verbose); - ; - for (int i = 0; i < ntheta; i++) { - att_r[i] = 0.5 * (Jtr[i] * Jtr[i] + Jrr[i] * Jrr[i]) * coeff_r / fabs(detDFinv_r[i]); - } - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(theta, "theta"); - disp(sin_theta, "sin_theta"); - disp(cos_theta, "cos_theta"); - disp(att_r, "att_r"); - } - return att_r; -} /* ----- end of level::att ----- */ -void gyro::arr_att_art(double r, std::vector theta, std::vector sin_theta, - std::vector cos_theta, int ntheta, std::vector& arr, std::vector& att, - std::vector& art, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - arr = std::vector(ntheta); - att = std::vector(ntheta); - art = std::vector(ntheta); - std::vector detDFinv_r = detDFinv(r, theta, sin_theta, cos_theta, ntheta, verbose); - std::vector Jrr(ntheta); - std::vector Jrt(ntheta); - std::vector Jtr(ntheta); - std::vector Jtt(ntheta); - functions->J_rr(r, theta, kappa_eps, delta_e, Rmax, Jrr, sin_theta, cos_theta); - functions->J_rt(r, theta, kappa_eps, delta_e, Rmax, Jrt, sin_theta, cos_theta); - functions->J_tr(r, theta, kappa_eps, delta_e, Rmax, Jtr, sin_theta, cos_theta); - functions->J_tt(r, theta, kappa_eps, delta_e, Rmax, Jtt, sin_theta, cos_theta); - double coeff_r = coeff_alpha(r, verbose); - for (int i = 0; i < ntheta; i++) { - double coeff = coeff_r / fabs(detDFinv_r[i]); - arr[i] = 0.5 * (Jtt[i] * Jtt[i] + Jrt[i] * Jrt[i]) * coeff; - art[i] = -0.25 * (Jtt[i] * Jtr[i] + Jrt[i] * Jrr[i]) * coeff; - att[i] = 0.5 * (Jtr[i] * Jtr[i] + Jrr[i] * Jrr[i]) * coeff; - } - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(theta, "theta"); - disp(sin_theta, "sin_theta"); - disp(cos_theta, "cos_theta"); - disp(arr, "arr"); - disp(att, "att"); - disp(art, "art"); - } -} /* ----- end of level::arr_att_art ----- */ -void gyro::arr_att_art(std::vector r, double theta, std::vector& arr_r, std::vector& att_r, - std::vector& art_r, int verbose) -{ - double t; - TIC; - - double kappa_eps = dcntl[Param::kappa_eps]; - double delta_e = dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - int size = r.size(); - arr_r = std::vector(size); - att_r = std::vector(size); - art_r = std::vector(size); - std::vector detDFinv_r = detDFinv(r, theta, verbose); - std::vector Jrr(size); - std::vector Jrt(size); - std::vector Jtr(size); - std::vector Jtt(size); - std::vector coeff_r = coeff_alpha(r, verbose); - functions->J_rr(r, theta, kappa_eps, delta_e, Rmax, Jrr); - functions->J_rt(r, theta, kappa_eps, delta_e, Rmax, Jrt); - functions->J_tr(r, theta, kappa_eps, delta_e, Rmax, Jtr); - functions->J_tt(r, theta, kappa_eps, delta_e, Rmax, Jtt); - for (std::size_t j = 0; j < r.size(); j++) { - double coeff = coeff_r[j] / fabs(detDFinv_r[j]); - arr_r[j] = 0.5 * (Jtt[j] * Jtt[j] + Jrt[j] * Jrt[j]) * coeff; - art_r[j] = -0.25 * (Jtt[j] * Jtr[j] + Jrt[j] * Jrr[j]) * coeff; - att_r[j] = 0.5 * (Jtr[j] * Jtr[j] + Jrr[j] * Jrr[j]) * coeff; - } - - dcntl[Param::t_arr_art_att] += TOC; - - if (gyro::icntl[Param::verbose] > 5) { - disp(r, "r"); - disp(detDFinv_r, "detDFinv_r"); - disp(coeff_r, "coeff_r"); - disp(arr_r, "arr_r"); - disp(att_r, "att_r"); - disp(art_r, "art_r"); - } -} /* ----- end of level::arr_att_art ----- */ - -/*************************************************************************** - * Polar to cartesian and back - **************************************************************************/ -/************************ - * Single - ************************/ -/*! - * \brief Transform from polar to cartesian - * - * Transform one couple r_i,theta_j from polar to cartesian - * - * \param r_i: the r coordinate of the node - * \param theta_j: the theta coordinate of the node - * \param x: the x coordinate of the node (out) - * \param y: the y coordinate of the node (out) - * \param verbose: verbose level for debug - * - */ -void gyro::trafo(double& r_i, double& theta_j, double& x, double& y, int verbose) -{ - double t; - TIC; - - double kappa_eps = gyro::dcntl[Param::kappa_eps]; - double delta_e = gyro::dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - - x = functions->x(r_i, theta_j, kappa_eps, delta_e, Rmax); - y = functions->y(r_i, theta_j, kappa_eps, delta_e, Rmax); - - dcntl[Param::t_trafo] += TOC; - - // if (verbose) - // std::cout << "TRAFO (" << r_i << ", " << theta_j << "): (" << x << ", " << y << ")\n"; -} /* ----- end of gyro::trafo ----- */ - -/*! - * \brief Transform from polar to cartesian - * - * TODO: This function could be reimplemented and used for simple geometries - * For more general geometries, the inverse mapping is not available - * and a check on the geometry would be needed. - * - * Transform one couple r_i,theta_j from cartesian to polar - * - * \param r_i: the r coordinate of the node (out) - * \param theta_j: the theta coordinate of the node (out) - * \param x: the x coordinate of the node - * \param y: the y coordinate of the node - * \param verbose: verbose level for debug - * - */ -void gyro::trafo_back(double& r_i, double& theta_j, double& x, double& y, int verbose) -{ - double t; - TIC; - - //double kappa_eps = gyro::dcntl[Param::kappa_eps]; - //double delta_e = gyro::dcntl[Param::delta_e]; - - throw std::runtime_error("No general inverse mapping available."); - /* - if (mod_pk == geometry::CIRCULAR) { - r_i = sqrt(x * x + y * y); - theta_j = atan2(y, x); - } - else if (mod_pk == geometry::SHAFRANOV) { - // Back transformer on (r,phi) of (x,y), see paper https://arxiv.org/pdf/1712.02201.pdf p.4 - r_i = sqrt(2 * ((x * x / pow(1 - kappa_eps, 2) + y * y / pow(1 + kappa_eps, 2))) / - (1 - 2 * delta_e * x / pow(1 - kappa_eps, 2) + - sqrt(pow(1 - 2 * delta_e * x / pow(1 - kappa_eps, 2), 2) - - 4 * pow(delta_e, 2) / pow(1 - kappa_eps, 2) * - (x * x / pow(1 - kappa_eps, 2) + y * y / pow(1 + kappa_eps, 2))))); - theta_j = atan2(y / (1 + kappa_eps), (x + delta_e * r_i * r_i) / (1 - kappa_eps)); - } - else if (mod_pk == geometry::TRIANGULAR) { - throw std::runtime_error("No inverse mapping available for the Czarny geometry."); - r_i = 0; - theta_j = 0; - }*/ - - dcntl[Param::t_trafo] += TOC; - - // if (verbose) - // std::cout << "TRAFO_BACK (" << x << ", " << y << "): (" << r_i << ", " << theta_j << ")\n"; -} /* ----- end of gyro::trafo_back ----- */ - -/************************ - * Vector - ************************/ -/*! - * \brief Transform from polar to cartesian - * - * Transform one couple r_i,theta_j from polar to cartesian - * - * \param r_i: the r coordinate of the node - * \param theta: vector theta (0, ntheta_int) - * \param sin_theta: sines of theta - * \param cos_theta: cosines of theta - * \param ntheta: number of values in theta - * \param x: vector x - * \param y: vector y - * \param verbose: verbose level for debug - * - */ -void gyro::trafo(double r_i, std::vector theta, std::vector sin_theta, std::vector cos_theta, - int ntheta, std::vector& x, std::vector& y, int verbose) -{ - double t; - TIC; - - double kappa_eps = gyro::dcntl[Param::kappa_eps]; - double delta_e = gyro::dcntl[Param::delta_e]; - double Rmax = dcntl[Param::R]; - x = std::vector(ntheta); - y = std::vector(ntheta); - - functions->x(r_i, theta, kappa_eps, delta_e, Rmax, x, sin_theta, cos_theta); - functions->y(r_i, theta, kappa_eps, delta_e, Rmax, y, sin_theta, cos_theta); - - dcntl[Param::t_trafo] += TOC; - - // if (verbose) - // for (int i = 0; i < ntheta; i++) { - // std::cout << "TRAFO (" << r_i << ", " << theta[i] << "): (" << x[i] << ", " << y[i] << ")\n"; - // } -} /* ----- end of gyro::trafo ----- */ - -/*! - * \brief Sparse matrix-vector product - * - * Sparse matrix-vector product: - * - (trans=0) y := alpha*A*x + beta*y - * - (trans=1) y := alpha*A^T*x + beta*y - * - */ -void gyro::sp_dgemv(int trans, int m, int n, double alpha, std::vector row_indices, std::vector col_indices, - std::vector vals, int lda, std::vector x, int incx, double beta, - std::vector& y, int incy) -{ - for (std::size_t i = 0; i < row_indices.size(); i++) { - y[i] = beta * (y[i] + (double)incy); - } - for (std::size_t i = 0; i < row_indices.size(); i++) { - y[row_indices[i]] += vals[i] * (x[col_indices[i]] + (double)incx); - } -} - -/*! - * \brief 2-norm of a vector - * - * Computes the 2-norm of a vector - * - */ -double gyro::norm(std::vector x) -{ - double nrmres = 0; - for (std::size_t i = 0; i < x.size(); i++) { - nrmres += pow(x[i], 2); - } - return sqrt(nrmres); -} - -/*! - * \brief 2-norm of a vector - * - * Computes the 2-norm of a matrix - * - */ -double gyro::A_norm(std::vector x, int m, std::vector row_indices, std::vector col_indices, - std::vector vals) -{ - double nrmres = 0; - std::vector Ax(m, 0.0); - sp_dgemv(0, m, m, 1.0, row_indices, col_indices, vals, m, x, 0, 1.0, Ax, 0); - for (std::size_t i = 0; i < x.size(); i++) { - nrmres += pow(x[i] * Ax[i], 2); - } - return sqrt(nrmres); -} - -void gyro::get_geometry_coeffs(geometry_type geom) -{ - switch (geom) { - case CIRCULAR: - case CULHAM: - gyro::dcntl[Param::kappa_eps] = 0; - gyro::dcntl[Param::delta_e] = 0; - break; - case SHAFRANOV: - gyro::dcntl[Param::kappa_eps] = 0.3; - gyro::dcntl[Param::delta_e] = 0.2; - break; - case TRIANGULAR: - gyro::dcntl[Param::kappa_eps] = 0.3; - gyro::dcntl[Param::delta_e] = 1.4; - break; - } -} - -void gyro::select_functions_class(int alpha_coeff, int beta_coeff, int geometry, int problem) -{ - if (alpha_coeff < 0 or alpha_coeff > 3) - throw std::runtime_error("Unknown alpha coeff"); - if (beta_coeff < 0 or beta_coeff > 1) - throw std::runtime_error("Unknown beta coeff"); - if (geometry < 0 or geometry > 3) - throw std::runtime_error("Unknown geometry"); - if ((problem != 1 and problem < 3) or problem > 7) - throw std::runtime_error("Unknown problem"); - if (problem == 1) - throw std::runtime_error("Flat not implemented"); - - alpha_val alpha = (alpha_val)alpha_coeff; - geometry_type geom = (geometry_type)geometry; - problem_type prob = (problem_type)problem; - std::cout << "GEOMETRY: " << geom << "\n"; - if (beta_coeff) { - switch (alpha) { - case SONNENDRUCKER: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // throw std::runtime_error("Beta coeff cannot be 1/0"); - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - case ZONI: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // throw std::runtime_error("Beta coeff cannot be 1/0"); - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - case ZONI_SHIFTED: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - case CULHAM: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case REFINED_RADIUS: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - case CULHAM: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // throw std::runtime_error("Beta coeff cannot be 1/0"); - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - case POISSON: - throw std::runtime_error("Beta coeff cannot be 1/0"); - break; - default: - throw std::runtime_error("Wrong choice for the alpha coefficient\n"); - break; - } - } - else { - switch (alpha) { - case SONNENDRUCKER: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // switch (geom) { - // case CIRCULAR: gyro::functions = std::make_unique(); break; - // case SHAFRANOV: gyro::functions = std::make_unique(); break; - // case TRIANGULAR: gyro::functions = std::make_unique(); break; - // } - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - case ZONI: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // switch (geom) { - // case CIRCULAR: gyro::functions = std::make_unique(); break; - // case SHAFRANOV: gyro::functions = std::make_unique(); break; - // case TRIANGULAR: gyro::functions = std::make_unique(); break; - // } - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - case ZONI_SHIFTED: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // switch (geom) { - // case CIRCULAR: gyro::functions = std::make_unique(); break; - // case SHAFRANOV: gyro::functions = std::make_unique(); break; - // case TRIANGULAR: gyro::functions = std::make_unique(); break; - // } - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - case POISSON: - switch (prob) { - case CARTESIAN_R2: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case POLAR_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - case CARTESIAN_R6: - switch (geom) { - case CIRCULAR: - gyro::functions = std::make_unique(); - break; - case SHAFRANOV: - gyro::functions = std::make_unique(); - break; - case TRIANGULAR: - gyro::functions = std::make_unique(); - break; - default: - throw std::runtime_error("Wrong choice for the geometry\n"); - break; - } - break; - //case FLAT: - // switch (geom) { - // case CIRCULAR: gyro::functions = std::make_unique(); break; - // case SHAFRANOV: gyro::functions = std::make_unique(); break; - // case TRIANGULAR: gyro::functions = std::make_unique(); break; - // } - // break; - default: - throw std::runtime_error("Wrong choice for the problem\n"); - break; - } - break; - default: - throw std::runtime_error("Wrong choice for the alpha coefficient\n"); - break; - } - } -} diff --git a/src/level.cpp b/src/level.cpp deleted file mode 100644 index 42f08a2e..00000000 --- a/src/level.cpp +++ /dev/null @@ -1,1438 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file level.cpp - * \brief Header for the class level - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "level.h" - -/*! - * \brief Default Constructor of level class - * - * Default constructor of the level class, sets default values for - * attributes. - * - */ -level::level(int l_) -{ - l = l_; - nr = 0; - ntheta = 0; - reset_timers(); - delete_circles = 0; - -#ifdef GMGPOLAR_USE_MUMPS - init_mumps(mumps_Ac); - if (gyro::icntl[Param::optimized] == 0) { - for (int i = 0; i < 4; i++) { - init_mumps(mumps_A_Zebra[i]); - } - } - else { - init_mumps(mumps_across); - } -#endif -} /* ----- end of constructor level:level ----- */ - -/*! - * \brief Default Destructor of level class - * - * Default destructor of the level class. - * - */ -level::~level() -{ -#ifdef GMGPOLAR_USE_MUMPS - finalize_mumps(mumps_Ac); - if (gyro::icntl[Param::optimized] == 0) { - for (int i = 0; i < 4; i++) { - finalize_mumps(mumps_A_Zebra[i]); - } - } - else { - finalize_mumps(mumps_across); - } -#endif - if (delete_circles > 0) { - for (int smoother = 0; smoother < 4; smoother++) { - delete[] dep_Asc_ortho[smoother]; - delete[] dep_Asc[smoother]; - } - // delete[] dep_u; - } -} /* ----- end of destructor level::~level ----- */ - -/*! - * \brief Sets execution times to 0 - * - * Sets execution times to 0. - * - */ -void level::reset_timers() -{ - t_smoothing = 0; - t_f_sc = 0; - t_Asc_ortho = 0; - t_Asc = 0; - t_get_ptr = 0; - t_get_stencil = 0; - t_get_smoother = 0; - t_get_row = 0; -} /* ----- end of level::reset_timers ----- */ - -/*! - * \brief Display the array theta - * - * Display the array theta - * - */ -void level::display_r() -{ - gyro::disp(r, "Coordinates r"); -} /* ----- end of level::display_r ----- */ - -/*! - * \brief Display the array theta - * - * Display the array theta - * - */ -void level::display_theta() -{ - gyro::disp(theta, "Coordinates theta"); -} /* ----- end of level::display_theta ----- */ - -/*! - * \brief Defines the number of entries in A - * - * returns the numbr of entries in the matrix A - * - */ -void level::define_nz() -{ - nz = 0; - int nr_left = nr; - int nb_DB = (gyro::icntl[Param::DirBC_Interior]) ? 2 : 1; - // - Dirichlet BC nodes - nz += nb_DB * ntheta_int; - nr_left -= nb_DB; - nz += nb_DB * 4 * ntheta_int; // Nodes linked to Dirichlet BC nodes - if (gyro::icntl[Param::mod_pk] > 0) - nz += nb_DB * 2 * ntheta_int; // Only take diagonal values if deformed circle - nr_left -= nb_DB; - // - Across the origin nodes - if (!gyro::icntl[Param::DirBC_Interior]) { - nz += 5 * ntheta_int; // accross the origin - if (gyro::icntl[Param::mod_pk] > 0) - nz += 2 * ntheta_int; // Only take diagonal values if deformed circle - nr_left--; - } - // - Interior nodes - nz += 5 * ntheta_int * nr_left; - if (gyro::icntl[Param::mod_pk] > 0) - nz += 4 * ntheta_int * nr_left; // internal circle -} /* ----- end of gyro::define_nz ----- */ - -/*! - * \brief Defines the index of an entry in A - * - * returns the index of the first entry in the row corresponding to the node (r_j, theta_i) - * - * \param i: the index of the theta coordinate - * \param j: the index of the r coordinate - * - * \return the index - */ -int level::get_ptr(int i, int j) -{ - int ptr = 0; - int nr_left = (j > nr_int - 2) ? nr_int - 1 : j; - i = (i + ntheta_int) % ntheta_int; - - // First circle - int index_theta = (j == 0) ? i : ntheta_int; - // - Dirichlet - if (gyro::icntl[Param::DirBC_Interior]) - ptr += index_theta; - // - Across the origin - else { - ptr += 5 * index_theta; // accross the origin - if (gyro::icntl[Param::mod_pk] > 0) - ptr += 2 * index_theta; // Only take diagonal values if deformed circle - } - nr_left--; - if (j == 0) - return ptr; - - // Second circle if Dirichlet - index_theta = (j == 1) ? i : ntheta_int; - if (gyro::icntl[Param::DirBC_Interior]) { - ptr += 4 * index_theta; // Nodes linked to Dirichlet BC nodes - if (gyro::icntl[Param::mod_pk] > 0) - ptr += 2 * index_theta; // Only take diagonal values if deformed circle - nr_left--; - } - if (gyro::icntl[Param::DirBC_Interior] && j == 1) - return ptr; - - // Interior nodes - index_theta = (j < nr_int - 1) ? i : 0; - ptr += 5 * (ntheta_int * nr_left + index_theta); - if (gyro::icntl[Param::mod_pk] > 0) - ptr += 4 * (ntheta_int * nr_left + index_theta); // internal circle - if (j < nr_int - 1) - return ptr; - - // Penultian circle - index_theta = (j == nr_int - 1) ? i : ntheta_int; - // - Dirichlet - ptr += 4 * index_theta; // Nodes linked to Dirichlet BC nodes - if (gyro::icntl[Param::mod_pk] > 0) - ptr += 2 * index_theta; // Only take diagonal values if deformed circle - if (j == nr_int - 1) - return ptr; - - // Last circle - index_theta = (j == nr_int) ? i : ntheta_int; - // - Dirichlet - ptr += index_theta; - - return ptr; -} /* ----- end of gyro::get_ptr ----- */ - -/*! - * \brief Defines the index of entry for a whole radius in A - * - * returns the index of all entries in the row corresponding to the nodes in r_j - * - * \param j: the index of the r coordinate - * - * \return the vector of index - * - */ -std::vector level::get_ptr(int j) -{ - int ptr = 0; - int shift; - int nr_left = (j > nr_int - 2) ? nr_int - 1 : j; - std::vector ptr_vect(ntheta_int + 2); - - // First circle - // - Dirichlet - if (gyro::icntl[Param::DirBC_Interior]) - shift = 1; - // - Across the origin - else { - shift = 5; // accross the origin - if (gyro::icntl[Param::mod_pk] > 0) - shift = 7; // Only take diagonal values if deformed circle - } - if (j > 0) { - ptr += shift * ntheta_int; - nr_left--; - - // DB_int - if (gyro::icntl[Param::DirBC_Interior]) { - shift = 4; // Nodes linked to Dirichlet BC nodes - if (gyro::icntl[Param::mod_pk] > 0) - shift = 6; // Only take diagonal values if deformed circle - if (j > 1) { - ptr += shift * ntheta_int; - nr_left--; - } - } - } - // Interior nodes - if (j > 1 || (j > 0 && !gyro::icntl[Param::DirBC_Interior])) { - shift = 5; - if (gyro::icntl[Param::mod_pk] > 0) - shift = 9; - ptr += shift * ntheta_int * nr_left; - } - // Penultian circle - if (j >= nr_int - 1) { - // - DB_ext - shift = 4; - if (gyro::icntl[Param::mod_pk] > 0) - shift = 6; - } - // Last circle - if (j > nr_int - 1) { - ptr += shift * ntheta_int; - // - Dirichlet - shift = 1; - } - - for (int i = 0; i < ntheta_int; i++) - ptr_vect[i + 1] = ptr + i * shift; - ptr_vect[0] = ptr_vect[ntheta_int]; - ptr_vect[ntheta_int + 1] = ptr_vect[1]; - return ptr_vect; -} /* ----- end of gyro::get_ptr ----- */ - -/*! - * \brief Defines shifting of each element in the stencil for A - * - * For each node, there are a certain number of entries in the matrix. - * Here we define, for the 9 point stencil, what is the position of each entry. - * -1 means that this entry is not part of the stencil. - * We consider all nodes on a same row have an identical stencil. - * - * \param j: the index of the r coordinate - * - * \return the corresponding stencil - * - */ -std::vector level::get_stencil(int j) -{ - std::vector stencil; - std::vector stencil_DB{-1, -1, -1, -1, 0, -1, -1, -1, -1}; - std::vector stencil_DB_int_next, stencil_DB_ext_next, stencil_accross, stencil_interior; - if (gyro::icntl[Param::mod_pk] == 0) { - stencil_DB_int_next = std::vector{-1, -1, -1, 0, 1, 2, -1, 3, -1}; - stencil_DB_ext_next = std::vector{-1, 0, -1, 1, 2, 3, -1, -1, -1}; - stencil_accross = std::vector{-1, 0, -1, 1, 2, 3, -1, 4, -1}; - stencil_interior = std::vector{-1, 0, -1, 1, 2, 3, -1, 4, -1}; - } - else { - stencil_DB_int_next = std::vector{-1, -1, -1, 0, 1, 2, 3, 4, 5}; - stencil_DB_ext_next = std::vector{0, 1, 2, 3, 4, 5, -1, -1, -1}; - stencil_accross = std::vector{-1, 0, -1, 1, 2, 3, 4, 5, 6}; - stencil_interior = std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8}; - } - - if ((j == 0 && gyro::icntl[Param::DirBC_Interior]) || j == nr_int) - stencil = stencil_DB; - else if (j == 0 && !gyro::icntl[Param::DirBC_Interior]) - stencil = stencil_accross; - else if (j == 1 && gyro::icntl[Param::DirBC_Interior]) - stencil = stencil_DB_int_next; - else if (j == nr_int - 1) - stencil = stencil_DB_ext_next; - else - stencil = stencil_interior; - - return stencil; -} /* ----- end of gyro::get_stencil ----- */ - -/*! - * \brief Defines the number of entries in P - * - * Each coarse node prolongation on a 9-pt stencil - * except the first and last lines which only propagates on the same radius (3-pt) - * returns the numbr of entries in the matrix P - * - */ -void level::define_nz_P() -{ - // nz_P = 9 * ntheta_int * (nr_int / 2 - 1) / 2 + 3 * ntheta_int; - nz_P = (nr_int / 2 + 1) * (ntheta_int / 2) // coarse nodes - + 2 * (nr_int / 2 + 1) * ntheta_int / 2 // same theta - + 2 * (nr_int / 2) * ntheta_int / 2 // same r - + 4 * (nr_int / 2) * ntheta_int / 2; // diagonal relations - - nz_P_inj = mc; - // nz_P_ex = 7 * ntheta_int * (nr_int / 2 - 1) / 2 + 3 * ntheta_int; - nz_P_ex = (nr_int / 2 + 1) * (ntheta_int / 2) // coarse nodes - + 2 * (nr_int / 2 + 1) * ntheta_int / 2 // same theta - + 2 * (nr_int / 2) * ntheta_int / 2 // same r - + 2 * (nr_int / 2) * ntheta_int / 2; // diagonal relations - - // 9 * ntheta_int * nr_int / 4 - // - 9 * ntheta_int / 2 - // + 3 * ntheta_int; -} /* ----- end of gyro::define_nz_P ----- */ - -/*! - * \brief Defines the size and number of entries in Asc/Asc_ortho - * - * returns the size and number of entries in the matrix Asc/Asc_ortho - * - */ -void level::define_m_nz_Asc() -{ - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - int nz_DB, nz_accross, nz_circle, nz_radial_circle, nz_radial, nz_DB_ext; - int nz_DB_noextr, nz_accross_noextr, nz_circle_noextr, nz_radial_circle_noextr, nz_radial_noextr, nz_DB_ext_noextr; - int nz_1st, nz_2nd; - double half = (extrapol) ? 0.5 : 1.0; - - // Define the size of Asc - // - not optimized: complete size - // - optimized: just the size for 1 row - m_sc = std::vector(4); - m_sc = std::vector(4); - if (gyro::icntl[Param::optimized] == 0) { - m_sc[0] = ceil(delete_circles * 0.5) * ntheta_int * half; - m_sc[1] = floor(delete_circles * 0.5) * ntheta_int; - m_sc[2] = ntheta_int * floor((nr_int - delete_circles + 1) * half) * 0.5; - m_sc[3] = ntheta_int * (nr_int - delete_circles + 1) * 0.5; - } - else { - m_sc[0] = ntheta_int * half; - m_sc[1] = ntheta_int; - m_sc[2] = (nr - delete_circles + extrapol * ((nr % 2 == 0) - (delete_circles % 2 == 0))) * half; - m_sc[3] = (nr_int - delete_circles + 1); - } - - // Define the number of entries in Asc_ortho - if (gyro::icntl[Param::mod_pk] == 0) { - nz_DB_noextr = 0; - nz_accross_noextr = 1; - nz_circle_noextr = 2; - nz_radial_circle_noextr = 3; - nz_radial_noextr = 2; - nz_DB_ext_noextr = 2; - nz_accross = (extrapol) ? 3 : nz_accross_noextr; - nz_circle = (extrapol) ? 4 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 4 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 4 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 3 : nz_DB_ext_noextr; - } - else { - nz_DB_noextr = 0; - nz_accross_noextr = 3; - nz_circle_noextr = 6; - nz_radial_circle_noextr = 7; - nz_radial_noextr = 6; - nz_DB_ext_noextr = 4; - nz_accross = (extrapol) ? 5 : nz_accross_noextr; - nz_circle = (extrapol) ? 8 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 8 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 8 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 5 : nz_DB_ext_noextr; - } - nz_radial_circle = (extrapol && delete_circles % 2 == 0) ? 0 : nz_radial_circle; - nz_DB = (extrapol) ? 0 : nz_DB_noextr; - nz_1st = (gyro::icntl[Param::DirBC_Interior]) ? nz_DB_noextr : nz_accross; - // DB_int and Across give the same number of entries here - nz_2nd = (gyro::icntl[Param::DirBC_Interior]) ? nz_accross_noextr : nz_circle_noextr; - nz_sc_ortho = std::vector(4); - nz_sc_ortho[0] = (nz_1st + nz_circle * (ceil(delete_circles * 0.5) - 1)) * ntheta_int * half; - nz_sc_ortho[1] = (nz_2nd + nz_circle_noextr * (floor(delete_circles * 0.5) - 1)) * ntheta_int; - nz_sc_ortho[2] = (nz_radial_circle + floor(nz_radial * (nr_int - delete_circles - 2) * half) + nz_DB_ext + nz_DB) * - ntheta_int * 0.5; - nz_sc_ortho[3] = - (nz_radial_circle_noextr + nz_radial_noextr * (nr_int - delete_circles - 2) + nz_DB_ext_noextr + nz_DB_noextr) * - ntheta_int * 0.5; -} /* ----- end of gyro::define_m_nz_Asc ----- */ - -/*! - * \brief Defines the size and number of entries in Asc/Asc_ortho - * - * returns the size and number of entries in the matrix Asc/Asc_ortho - * - */ -int level::define_nz_Asc_ij(int smoother, int ij, int ortho) -{ - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - int nz_DB, nz_accross, nz_circle, nz_radial_circle, nz_radial, nz_DB_ext; - int nz_DB_noextr, nz_accross_noextr, nz_circle_noextr, nz_radial_circle_noextr, nz_radial_noextr, nz_DB_ext_noextr; - int nz_1st, nz_2nd; - int nz = 0; - double half = (extrapol) ? 0.5 : 1.0; - - if (!ortho) { - nz_DB_noextr = 1; - nz_accross_noextr = 4; - nz_circle_noextr = 3; - nz_radial_circle_noextr = 2; - nz_radial_noextr = 3; - nz_DB_ext_noextr = 2; - nz_DB = (extrapol) ? 0 : nz_DB_noextr; - nz_accross = (extrapol) ? 2 : nz_accross_noextr; - nz_circle = (extrapol) ? 1 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 1 : nz_radial_circle_noextr; - nz_radial_circle = (extrapol && delete_circles % 2 == 0) ? 0 : nz_radial_circle; - nz_radial = (extrapol) ? 1 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 1 : nz_DB_ext_noextr; - nz_1st = (gyro::icntl[Param::DirBC_Interior]) ? nz_DB_noextr : nz_accross; - nz_2nd = nz_circle_noextr; - } - else { - if (gyro::icntl[Param::mod_pk] == 0) { - nz_DB_noextr = 0; - nz_accross_noextr = 1; - nz_circle_noextr = 2; - nz_radial_circle_noextr = 3; - nz_radial_noextr = 2; - nz_DB_ext_noextr = 2; - nz_accross = (extrapol) ? 3 : nz_accross_noextr; - nz_circle = (extrapol) ? 4 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 4 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 4 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 3 : nz_DB_ext_noextr; - } - else { - nz_DB_noextr = 0; - nz_accross_noextr = 3; - nz_circle_noextr = 6; - nz_radial_circle_noextr = 7; - nz_radial_noextr = 6; - nz_DB_ext_noextr = 4; - nz_accross = (extrapol) ? 5 : nz_accross_noextr; - nz_circle = (extrapol) ? 8 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 8 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 8 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 5 : nz_DB_ext_noextr; - } - nz_radial_circle = (extrapol && delete_circles % 2 == 0) ? 0 : nz_radial_circle; - nz_DB = (extrapol) ? 0 : nz_DB_noextr; - nz_1st = (gyro::icntl[Param::DirBC_Interior]) ? nz_DB_noextr : nz_accross; - // DB_int and Across give the same number of entries here - nz_2nd = (gyro::icntl[Param::DirBC_Interior]) ? nz_accross_noextr : nz_circle_noextr; - } - if (smoother == 0) { - if (ij == 0) - nz = nz_1st * ntheta_int * half; - else - nz = nz_circle * ntheta_int * half; - } - else if (smoother == 1) { - if (ij == 1) - nz = nz_2nd * ntheta_int; - else - nz = nz_circle_noextr * ntheta_int; - } - else if (smoother == 2) { - nz = nz_radial_circle + floor(nz_radial * (nr_int - delete_circles - 2) * half) + nz_DB_ext + nz_DB; - } - else if (smoother == 3) { - nz = nz_radial_circle_noextr + nz_radial_noextr * (nr_int - delete_circles - 2) + nz_DB_ext_noextr + - nz_DB_noextr; - } - return nz; -} /* ----- end of gyro::define_m_nz_Asc_ij ----- */ - -/*! - * \brief Defines the index of entry for a whole radius in Asc/Asc_ortho - * - * returns the index of all entries in the row corresponding to the nodes in r_j - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param ortho: 0: Asc, 1: Asc_ortho - * - * \return the vector of index - * - */ -std::vector level::get_ptr_sc(int j, int smoother, int ortho) -{ - double t; - TIC; - - if ((j >= delete_circles && smoother < 2) || j < delete_circles && smoother > 1) - throw std::runtime_error("(get_ptr_sc) Incompatible radius and smoother."); - - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - // For the radial smoother, we need to separate smoother 2 and 3 (ptr/ptr3 and shift/shift3) - // since we explore radius per raidus - int ptr = 0, ptr3 = 0; - int shift, shift3, nr_left; - int nz_DB, nz_accross, nz_circle, nz_radial_circle, nz_radial, nz_DB_ext; - int nz_DB_noextr, nz_accross_noextr, nz_circle_noextr, nz_radial_circle_noextr, nz_radial_noextr, nz_DB_ext_noextr; - int nz_1st, nz_2nd; - double half = (extrapol && smoother != 1) ? 0.5 : 1.0; - std::vector ptr_vect(ntheta_int); - - if (!ortho) { - nz_DB_noextr = 1; - nz_accross_noextr = 4; - nz_circle_noextr = 3; - nz_radial_circle_noextr = 2; - nz_radial_noextr = 3; - nz_DB_ext_noextr = 2; - nz_accross = (extrapol) ? 2 : nz_accross_noextr; - nz_circle = (extrapol) ? 1 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 1 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 1 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 1 : nz_DB_ext_noextr; - nz_2nd = nz_circle_noextr; - } - else { - if (gyro::icntl[Param::mod_pk] == 0) { - nz_DB_noextr = 0; - nz_accross_noextr = 1; - nz_circle_noextr = 2; - nz_radial_circle_noextr = 3; - nz_radial_noextr = 2; - nz_DB_ext_noextr = 2; - nz_accross = (extrapol) ? 3 : nz_accross_noextr; - nz_circle = (extrapol) ? 4 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 4 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 4 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 3 : nz_DB_ext_noextr; - } - else { - nz_DB_noextr = 0; - nz_accross_noextr = 3; - nz_circle_noextr = 6; - nz_radial_circle_noextr = 7; - nz_radial_noextr = 6; - nz_DB_ext_noextr = 4; - nz_accross = (extrapol) ? 5 : nz_accross_noextr; - nz_circle = (extrapol) ? 8 : nz_circle_noextr; - nz_radial_circle = (extrapol) ? 8 : nz_radial_circle_noextr; - nz_radial = (extrapol) ? 8 : nz_radial_noextr; - nz_DB_ext = (extrapol) ? 5 : nz_DB_ext_noextr; - } - // DB_int and Across give the same number of entries here - nz_2nd = (gyro::icntl[Param::DirBC_Interior]) ? nz_accross_noextr : nz_circle_noextr; - } - nz_1st = (gyro::icntl[Param::DirBC_Interior]) ? nz_DB_noextr : nz_accross; - nz_radial_circle = (extrapol && delete_circles % 2 == 0) ? 0 : nz_radial_circle; - nz_DB = (extrapol) ? 0 : nz_DB_noextr; - - if (!ortho) { - if (j < delete_circles) { - if (smoother == 0) { - shift = nz_1st; - if (j > 0) { - shift = nz_circle; - } - } - else if (smoother == 1) { - shift = nz_2nd; - if (j > 1) { - shift = nz_circle_noextr; - } - } - // In case of extrapol and smoother==0, there are only half of points in the grid: take twice - // the same values for each in order to respect the theta index i - for (int i = 0; i < ntheta_int; i++) - ptr_vect[i] = ptr + floor(i * half) * shift; - } - else { - shift = nz_radial_circle; - shift3 = nz_radial_circle_noextr; - if (j > delete_circles) { - ptr += shift; - ptr3 += shift3; - - // Radial nodes - shift = nz_radial; - shift3 = nz_radial_noextr; - ptr += shift * floor(std::min(j - delete_circles - 1, nr_int - delete_circles - 2) * half); - ptr3 += shift3 * std::min(j - delete_circles - 1, nr_int - delete_circles - 2); - } - // - DB_ext - if (j >= nr_int - 1) { - shift = nz_DB_ext; - shift3 = nz_DB_ext_noextr; - } - // Last circle - if (j > nr_int - 1) { - ptr += shift; - ptr3 += shift3; - shift = nz_DB; - shift3 = nz_DB_noextr; - } - - for (int i = 0; i < ntheta_int; i += 2) { - ptr_vect[i] = ptr; - ptr_vect[i + 1] = ptr3; - } - } - } - else { - if (j < delete_circles) { - if (smoother == 0) { - shift = nz_1st; - if (j > 0) { - ptr += shift * ntheta_int * half; - - shift = nz_circle; - nr_left = ceil((double)(j - 1) * 0.5) - 1; - ptr += shift * nr_left * ntheta_int * half; - } - } - else if (smoother == 1) { - shift = nz_2nd; - if (j > 1) { - ptr += shift * ntheta_int * half; - - shift = nz_circle_noextr; - nr_left = floor((double)(j - 1) * 0.5) - 1; - ptr += shift * nr_left * ntheta_int; - } - } - // In case of extrapol and smoother==0, there are only half of points in the grid: take twice - // the same values for each in order to respect the theta index i - for (int i = 0; i < ntheta_int; i++) - ptr_vect[i] = ptr + floor(i * half) * shift; - } - else { - // Radial-Circle nodes - shift = nz_radial_circle; - shift3 = nz_radial_circle_noextr; - if (j > delete_circles) { - ptr += shift * ntheta_int * 0.5; - ptr3 += shift3 * ntheta_int * 0.5; - - // Radial nodes - shift = nz_radial; - shift3 = nz_radial_noextr; - ptr += shift * floor(std::min(j - delete_circles - 1, nr_int - delete_circles - 2) * half) * - ntheta_int / 2; - ptr3 += shift3 * std::min(j - delete_circles - 1, nr_int - delete_circles - 2) * ntheta_int / 2; - } - // - DB_ext - if (j >= nr_int - 1) { - shift = nz_DB_ext; - shift3 = nz_DB_ext_noextr; - } - // Last circle - if (j > nr_int - 1) { - ptr += shift * ntheta_int / 2; - ptr3 += shift3 * ntheta_int / 2; - shift = nz_DB; - shift3 = nz_DB_noextr; - } - - for (int i = 0; i < ntheta_int; i += 2) { - ptr_vect[i] = ptr + i / 2 * shift; - ptr_vect[i + 1] = ptr3 + i / 2 * shift3; - } - } - } - -#pragma omp atomic - t_get_ptr += TOC; - - return ptr_vect; -} /* ----- end of gyro::get_ptr_sc ----- */ - -/*! - * \brief Defines the smoother on node (i, j) - * - * Defines the smoother on node (i, j) - * - * \param i: the index of the theta coordinate - * \param j: the index of the r coordinate - * - * \return the corresponding smoother - * - */ -int level::get_smoother(int i, int j) -{ - double t; - TIC; - - int smoother = 0; - //!check, which smoother the point belongs to: 0 circle black, 1 circle white, 2 radial black, 3 radial white - if (j < delete_circles) { - if (j % 2 == 0) { - smoother = 0; //circle black (even) - } - else { - smoother = 1; //circle white (odd) - } - } - else { - if (i % 2 == 0) { - smoother = 2; //radial black (even) - } - else { - smoother = 3; //radial white (odd) - } - } - -#pragma omp atomic - t_get_smoother += TOC; - - return smoother; -} /* ----- end of gyro::get_smoother ----- */ - -/*! - * \brief Defines the smoother for a whole theta line - * - * Defines the smoother on theta i - * - * \param i: the index of the theta coordinate - * - * \return the corresponding smoothers - * - */ -std::vector level::get_smoother_circle(int i) -{ - double t; - TIC; - - std::vector smoother(delete_circles, 0); - for (int j = 1; j < delete_circles; j += 2) - smoother[j] = 1; - -#pragma omp atomic - t_get_smoother += TOC; - return smoother; -} /* ----- end of gyro::get_smoother_circle ----- */ - -/*! - * \brief Defines the smoother for a whole radius - * - * Defines the smoother on r j - * - * \param j: the index of the r coordinate - * - * \return the corresponding smoothers - * - */ -std::vector level::get_smoother_radial(int j) -{ - double t; - TIC; - - std::vector smoother(ntheta_int, 2); - for (int i = 1; i < ntheta_int; i += 2) - smoother[i] = 3; - -#pragma omp atomic - t_get_smoother += TOC; - return smoother; -} /* ----- end of gyro::get_smoother_radial ----- */ - -/*! - * \brief Defines shifting of each element in the stencil for Asc/Asc_ortho - * - * For each node, there are a certain number of entries in the matrix Asc/Asc_ortho. - * Here we define, for the 9 point stencil, what is the position of each entry. - * -1 means that this entry is not part of the stencil. - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param ortho: 0: Asc, 1: Asc_ortho - * - * \return the corresponding stencil - * - */ -std::vector level::get_stencil_sc(int j, int smoother, int ortho) -{ - double t; - TIC; - - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0 && (smoother == 0 || smoother == 2); - std::vector stencil, stencil_DB, stencil_DB_int, stencil_accross, stencil_circle, stencil_radial_circle, - stencil_radial, stencil_DB_ext; - - if (!ortho) { - if (!extrapol) { - stencil_DB = std::vector{-1, -1, -1, -1, 0, -1, -1, -1, -1}; - stencil_circle = std::vector{-1, -1, -1, 0, 1, 2, -1, -1, -1}; - stencil_accross = std::vector{-1, 0, -1, 1, 2, 3, -1, -1, -1}; - stencil_radial_circle = std::vector{-1, -1, -1, -1, 0, -1, -1, 1, -1}; - stencil_radial = std::vector{-1, 0, -1, -1, 1, -1, -1, 2, -1}; - stencil_DB_ext = std::vector{-1, 0, -1, -1, 1, -1, -1, -1, -1}; - } - else { - stencil_DB = std::vector{-1, -1, -1, -1, 0, -1, -1, -1, -1}; - stencil_accross = std::vector{-1, 0, -1, -1, 1, -1, -1, -1, -1}; - stencil_circle = stencil_DB; - stencil_radial_circle = stencil_DB; - stencil_radial = stencil_DB; - stencil_DB_ext = stencil_DB; - } - stencil_DB_int = stencil_circle; - } - else { - if (gyro::icntl[Param::mod_pk] == 0) { - if (!extrapol) { - stencil_DB = std::vector{-1, -1, -1, -1, -1, -1, -1, -1, -1}; - stencil_accross = std::vector{-1, -1, -1, -1, -1, -1, -1, 0, -1}; - stencil_circle = std::vector{-1, 0, -1, -1, -1, -1, -1, 1, -1}; - stencil_radial_circle = std::vector{-1, 0, -1, 1, -1, 2, -1, -1, -1}; - stencil_radial = std::vector{-1, -1, -1, 0, -1, 1, -1, -1, -1}; - stencil_DB_ext = std::vector{-1, -1, -1, 0, -1, 1, -1, -1, -1}; - } - else { - stencil_DB = std::vector{-1, -1, -1, -1, -1, -1, -1, -1, -1}; - stencil_accross = std::vector{-1, -1, -1, 0, -1, 1, -1, 2, -1}; - stencil_circle = std::vector{-1, 0, -1, 1, -1, 2, -1, 3, -1}; - stencil_radial_circle = stencil_circle; - stencil_radial = stencil_circle; - stencil_DB_ext = std::vector{-1, 0, -1, 1, -1, 2, -1, -1, -1}; - } - } - else { - if (!extrapol) { - stencil_DB = std::vector{-1, -1, -1, -1, -1, -1, -1, -1, -1}; - stencil_accross = std::vector{-1, -1, -1, -1, -1, -1, 0, 1, 2}; - stencil_circle = std::vector{0, 1, 2, -1, -1, -1, 3, 4, 5}; - stencil_radial_circle = std::vector{0, 1, 2, 3, -1, 4, 5, -1, 6}; - stencil_radial = std::vector{0, -1, 1, 2, -1, 3, 4, -1, 5}; - stencil_DB_ext = std::vector{0, -1, 1, 2, -1, 3, -1, -1, -1}; - } - else { - stencil_DB = std::vector{-1, -1, -1, -1, -1, -1, -1, -1, -1}; - stencil_accross = std::vector{-1, -1, -1, 0, -1, 1, 2, 3, 4}; - stencil_circle = std::vector{0, 1, 2, 3, -1, 4, 5, 6, 7}; - stencil_radial_circle = stencil_circle; - stencil_radial = stencil_circle; - stencil_DB_ext = std::vector{0, 1, 2, 3, -1, 4, -1, -1, -1}; - } - } - stencil_DB_int = stencil_accross; - } - - if (j == 0) - stencil = (gyro::icntl[Param::DirBC_Interior]) ? stencil_DB : stencil_accross; - else if (j == 1 && gyro::icntl[Param::DirBC_Interior]) - stencil = stencil_DB_int; - else if (j < delete_circles) - stencil = stencil_circle; - else if (j == delete_circles) - stencil = stencil_radial_circle; - else if (j < nr_int - 1) - stencil = stencil_radial; - else if (j == nr_int - 1) - stencil = stencil_DB_ext; - else if (j == nr_int) - stencil = stencil_DB; - else - throw std::runtime_error("(get_stencil_sc) Stencil not recognized."); - -#pragma omp atomic - t_get_stencil += TOC; - return stencil; -} /* ----- end of level::get_stencil_sc ----- */ - -/*! - * \brief Row/Column for the point (i, j) for Asc - * - * Returns the row/column for the point (i, j) with smoother and extrapol parameters for Asc - * - * \param i: the index of the theta coordinate - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param extrapol: level=0 and we use implicit extrapolation - * - * \return the corresponding row - * - */ -int level::get_row(int i, int j, int smoother, int extrapol) -{ - double t; - TIC; - - int row = 0; - if (smoother < 2) { - j = smoother; // row per row - row = ((j - smoother) * ntheta_int * 0.5 + i + extrapol * (smoother - 1)) / (1 + extrapol * (1 - smoother)); - } - else if (smoother > 1) { - // // Row-wise (mixed B n W) - // row = (j - delete_circles - extrapol * (3 - smoother) * (delete_circles % 2 == 0)) * ntheta_int * 0.5 / - // (1 + extrapol * (3 - smoother)) + - // (i + 2 - smoother) / 2; - // Col-wise (line by line) - // row = ((j - delete_circles - extrapol * (3 - smoother) * (delete_circles % 2 == 0)) + - // (i + 2 - smoother) * (nr - delete_circles + 1 - extrapol * (3 - smoother) * (nr + 1) % 2) * 0.5) / - // (1 + extrapol * (3 - smoother)); - i = 0; // column per column - row = (j - delete_circles - extrapol * (3 - smoother) * (delete_circles % 2 == 0)) / - (1 + extrapol * (3 - smoother)) + - (i + 2 - smoother) * 0.5 * - (nr - delete_circles + extrapol * (3 - smoother) * ((nr % 2 == 0) - (delete_circles % 2 == 0))) / - (1 + extrapol * (3 - smoother)); - } - -#pragma omp atomic - t_get_row += TOC; - return row; -} /* ----- end of level::get_row ----- */ - -/*! - * \brief Row/Column for a whole radius for Asc - * - * Returns the row/column for the whole radius j with smoother and extrapol parameters for Asc - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param extrapol: level=0 and we use implicit extrapolation - * - * \return the vector of row indices - * - */ -std::vector level::get_row(int j, int smoother, int extrapol, int local, int col_wise) -{ - double t; - TIC; - - double coeff, coeff2, coeff3, shift, shift2, shift3; - - std::vector row(ntheta_int); - if (smoother < 2) { - if (local) - j = smoother; // row per row - coeff = 1.0 / (double)(1 + extrapol * (1 - smoother)); - shift = ((j - smoother) * ntheta_int * 0.5 + extrapol * (smoother - 1)); - for (int i = 0; i < ntheta_int; i++) - row[i] = coeff * (i + shift); - } - else if (smoother > 1) { - // Row-wise (mixed B n W) - if (!col_wise) { - coeff = 0.5; - shift2 = - (j - delete_circles - extrapol * (delete_circles % 2 == 0)) * ntheta_int * 0.5 / (double)(1 + extrapol); - shift3 = ((j - delete_circles) * ntheta_int - 1) * 0.5; - for (int i = 0; i < ntheta_int; i += 2) - row[i] = coeff * i + shift2; - for (int i = 1; i < ntheta_int; i += 2) - row[i] = coeff * i + shift3; - } - else { - if (local) { - // Col-wise (line by line) - shift2 = (j - delete_circles - extrapol * (delete_circles % 2 == 0)) / (1 + extrapol); - shift3 = (j - delete_circles); // - 0.5 * (nr - delete_circles); - coeff2 = 0.5 * (nr - delete_circles + extrapol * ((nr % 2 == 0) - (delete_circles % 2 == 0))) / - (1 + extrapol); - coeff3 = 0.5 * (nr - delete_circles); - for (int i = 0; i < ntheta_int; i += 2) - row[i] = shift2; - for (int i = 1; i < ntheta_int; i += 2) - row[i] = shift3; - } - else { - shift2 = (j - delete_circles - extrapol * (delete_circles % 2 == 0)) / (1 + extrapol); - shift3 = (j - delete_circles) - 0.5 * (nr - delete_circles); - coeff2 = 0.5 * (nr - delete_circles + extrapol * ((nr % 2 == 0) - (delete_circles % 2 == 0))) / - (1 + extrapol); - coeff3 = 0.5 * (nr - delete_circles); - for (int i = 0; i < ntheta_int; i += 2) - row[i] = coeff2 * i + shift2; - for (int i = 1; i < ntheta_int; i += 2) - row[i] = coeff3 * i + shift3; - } - } - } - -#pragma omp atomic - t_get_row += TOC; - return row; -} /* ----- end of level::get_row ----- */ - -/*! - * \brief Row/Column for a whole radius for Asc - * - * Returns the row/column for the whole radius j with smoother and extrapol parameters for Asc - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param extrapol: level=0 and we use implicit extrapolation - * - * \return the vector of row indices - * - */ -std::vector level::get_row_i(int size, int i, int smoother, int extrapol) -{ - double t; - TIC; - - double coeff, shift; - - std::vector row(size); - if (smoother < 2) { - std::cout << "SHOULD NOT BE CALLED WITH THIS SMOOTHER\n"; - } - else if (smoother > 1) { - coeff = 1.0 / (1 + (3 - smoother) * extrapol); - shift = -delete_circles - (3 - smoother) * extrapol * (delete_circles % 2 == 0); - for (int j = 0; j < size; j++) - row[j] = coeff * (j + shift); - } - -#pragma omp atomic - t_get_row += TOC; - return row; -} /* ----- end of level::get_row ----- */ - -/*! - * \brief Row/Column for a whole radius for Asc - * - * Returns the row/column for the whole radius j with smoother and extrapol parameters for Asc - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param extrapol: level=0 and we use implicit extrapolation - * - * \return the vector of row indices - * - */ -std::vector level::get_row_i_glob(int size, int i, int smoother, int extrapol) -{ - double t; - TIC; - - double coeff, shift; - - std::vector row(size); - if (smoother < 2) { - std::cout << "SHOULD NOT BE CALLED WITH THIS SMOOTHER\n"; - } - else if (smoother > 1) { - coeff = 1.0 / (1 + (3 - smoother) * extrapol); - shift = (-delete_circles - extrapol * (3 - smoother) * (delete_circles % 2 == 0)) + - (i + 2 - smoother) * 0.5 * - (nr - delete_circles + extrapol * (3 - smoother) * ((nr % 2 == 0) - (delete_circles % 2 == 0))); - for (int j = 0; j < size; j++) - row[j] = coeff * (j + shift); - } - -#pragma omp atomic - t_get_row += TOC; - return row; -} /* ----- end of level::get_row ----- */ - -/*! - * \brief Row/Column for a whole radius for Asc - * - * Returns the row/column for the whole radius j with smoother and extrapol parameters for Asc - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param extrapol: level=0 and we use implicit extrapolation - * - * \return the vector of row indices - * - */ -int level::mapping_usc_to_u(int ind_sc, int smoother) -{ - double t; - TIC; - - int extrapol = gyro::icntl[Param::extrapolation]; - extrapol = extrapol == 1 && l == 0; - //only for the circle black smoother, don't change the variable of the class itself - - //computation of indices in the total vector u corresponding to the indices in u_sc - // for (long unsigned int ind_sc = 0; ind_sc < u_sc.size(); ++i) { - int row; - int col; - - if (smoother < 2) { //circle - int ntheta_int_local = ntheta_int; - if (extrapol && smoother == 0) { //circle, black - ntheta_int_local = ntheta_int / 2; - } - row = 2 * (ind_sc / ntheta_int_local); //row within the smoother - col = ind_sc % ntheta_int_local; - if (smoother == 1) { //white - row++; - } - if (extrapol && smoother == 0) { //black - col = col * 2 + 1; //augment col in case of extrapolation - } - } - else { //radial - // // Row-wise (mixed B n W) - // if (smoother == 2) { //black - // int n_lines_radial_b = ceil((double)ntheta_int / 2); - // row = ind_sc / n_lines_radial_b; //row within the smoother - // col = 2 * (ind_sc % n_lines_radial_b); //col within the smoother - // if (extrapol) { - // row = row * 2; //augment row in case of extrapolation - // if (delete_circles % 2 == 0) { //delete_circles = even - // row = row + 1; - // } - // } - // } - // else { //white - // int n_lines_radial_w = floor((double)ntheta_int / 2); - // row = ind_sc / n_lines_radial_w; //row within the smoother - // col = 2 * (ind_sc % n_lines_radial_w) + 1; //col within the smoother - // } - // Col-wise (line by line) - int n_rows = (nr - delete_circles + extrapol * (3 - smoother) * ((nr % 2 == 0) - (delete_circles % 2 == 0))) / - (1 + extrapol * (3 - smoother)); - col = 2 * (ind_sc / n_rows); - if (smoother == 3) - col++; - row = ind_sc % n_rows; - if (extrapol && smoother == 2) - row = 2 * row + (delete_circles + 1) % 2; - - row += delete_circles; //row within the whole matrix - } - - int ind = row * ntheta_int + col; - -#pragma omp atomic - t_get_row += TOC; - - return ind; -} /* ----- end of level::mapping_usc_to_u ----- */ - -/*! - * \brief Row/Column for a whole radius for Asc - * - * Returns the row/column for the whole radius j with smoother and extrapol parameters for Asc - * - * \param j: the index of the r coordinate - * \param smoother: the current smoother - * \param extrapol: level=0 and we use implicit extrapolation - * - * \return the vector of row indices - * - */ -std::vector level::mapping_usc_to_u(int ind_sc_start, int ind_sc_end, int smoother) -{ - double t; - TIC; - - int extrapol = gyro::icntl[Param::extrapolation]; - extrapol = extrapol == 1 && l == 0; - //only for the circle black smoother, don't change the variable of the class itself - - //computation of indices in the total vector u corresponding to the indices in u_sc - // for (long unsigned int ind_sc = 0; ind_sc < u_sc.size(); ++i) { - int row; - int col; - std::vector ind(ind_sc_end - ind_sc_start); - - if (smoother < 2) { //circle - int ntheta_int_local = ntheta_int; - int is_extrapol = 0; - if (extrapol && smoother == 0) { //circle, black - ntheta_int_local = ntheta_int / 2; - is_extrapol = 1; - } - for (int i = ind_sc_start; i < ind_sc_end; i++) { - row = 2 * (i / ntheta_int_local) + (smoother == 1); //row within the smoother - col = i % ntheta_int_local; - col = col * (1 + is_extrapol) + is_extrapol; - ind[i - ind_sc_start] = row * ntheta_int + col; - } - } - else { //radial - // Col-wise (line by line) - int n_rows = (nr - delete_circles + extrapol * (3 - smoother) * ((nr % 2 == 0) - (delete_circles % 2 == 0))) / - (1 + extrapol * (3 - smoother)); - int is_extrapol = 0; - if (extrapol && smoother == 2) - is_extrapol = 1; - for (int i = ind_sc_start; i < ind_sc_end; i++) { - col = 2 * (i / n_rows) + (smoother == 3); - row = i % n_rows; - row = row * (1 + is_extrapol) + is_extrapol * ((delete_circles + 1) % 2); - row += delete_circles; - ind[i - ind_sc_start] = row * ntheta_int + col; - } - } - -#pragma omp atomic - t_get_row += TOC; - - return ind; -} /* ----- end of level::mapping_usc_to_u ----- */ - -/*! - * \brief Creates grid division in r from a file - * - * Creates grid division in r from a file containing comma-separated radii - * - */ -void level::read_grid_r() -{ - std::fstream f; - - f.open(gyro::f_grid_r.c_str(), std::ios::in); - if (!f) { - std::cout << "No such file: " << gyro::f_grid_r.c_str() << "\n"; - } - else { - while (1) { - double r_val; - f >> r_val; - if (f.eof()) - break; - r.push_back(r_val); - } - } - f.close(); - nr = r.size(); -} /* ----- end of level::read_grid ----- */ - -/*! - * \brief Creates grid division in theta from a file - * - * Creates grid division in theta from a file containing comma-separated radii - * - */ -void level::read_grid_theta() -{ - std::fstream f; - - f.open(gyro::f_grid_theta.c_str(), std::ios::in); - if (!f) { - std::cout << "No such file: " << gyro::f_grid_theta.c_str() << "\n"; - } - else { - while (1) { - double theta_val; - f >> theta_val; - if (f.eof()) - break; - theta.push_back(theta_val); - } - } - f.close(); - ntheta = theta.size(); -} /* ----- end of level::read_grid ----- */ - -/*! - * \brief Creates grid division in r from a file - * - * Creates grid division in r from a file containing comma-separated radii - * - */ -void level::write_grid_r() -{ - std::fstream f; - std::stringstream folder; - - size_t pos = 0; - std::string token; - std::string original = gyro::f_grid_r; - while ((pos = original.find("/")) != std::string::npos) { - token = original.substr(0, pos); - folder << token << "/"; - original.erase(0, pos + 1); - const int dir_err0 = mkdir(folder.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - } - - f.open(gyro::f_grid_r.c_str(), std::ios::out); - if (!f) { - std::cout << "No such file: " << gyro::f_grid_r.c_str() << "\n"; - } - else { - for (int i = 0; i < r.size(); i++) { - f << std::setprecision(17) << r[i] << "\n"; - } - } - f.close(); -} /* ----- end of level::read_grid ----- */ - -/*! - * \brief Creates grid division in theta from a file - * - * Creates grid division in theta from a file containing comma-separated radii - * - */ -void level::write_grid_theta() -{ - std::fstream f; - std::stringstream folder; - - size_t pos = 0; - std::string token; - std::string original = gyro::f_grid_theta; - while ((pos = original.find("/")) != std::string::npos) { - token = original.substr(0, pos); - folder << token << "/"; - original.erase(0, pos + 1); - const int dir_err0 = mkdir(folder.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - } - - f.open(gyro::f_grid_theta.c_str(), std::ios::out); - if (!f) { - std::cout << "No such file: " << gyro::f_grid_theta.c_str() << "\n"; - } - else { - for (int i = 0; i < theta.size(); i++) { - f << std::setprecision(17) << theta[i] << "\n"; - } - } - f.close(); -} /* ----- end of level::read_grid ----- */ - -/*! - * \brief Reads the theoretical solution - * - * Reads the theoretical solution from an input file with 1 entry per line - * - */ -void level::read_sol() -{ - std::fstream f; - - f.open(gyro::f_sol_in.c_str(), std::ios::in); - if (!f) { - std::cout << "No such file: " << gyro::f_sol_in.c_str() << "\n"; - } - else { - while (1) { - double r_val; - f >> r_val; - if (f.eof()) - break; - sol_in.push_back(r_val); - } - } - f.close(); - if (sol_in.size() != (size_t)m) - throw std::runtime_error("The provided theoretical solution does not have the same size m as the system."); -} /* ----- end of level::read_grid ----- */ - -/*! - * \brief Creates grid division in theta from a file - * - * Creates grid division in theta from a file containing comma-separated radii - * - */ -void level::write_sol() -{ - std::fstream f; - std::stringstream folder; - - size_t pos = 0; - std::string token; - std::string original = gyro::f_sol_out; - while ((pos = original.find("/")) != std::string::npos) { - token = original.substr(0, pos); - folder << token << "/"; - original.erase(0, pos + 1); - const int dir_err0 = mkdir(folder.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - } - - f.open(gyro::f_sol_out.c_str(), std::ios::out); - if (!f) { - std::cout << "No such file: " << gyro::f_sol_out.c_str() << "\n"; - } - else { - f << "# nr : " << r.size() << " ntheta : " << theta.size() << std::endl; - double kappa_eps = gyro::dcntl[Param::kappa_eps]; - double delta_e = gyro::dcntl[Param::delta_e]; - double Rmax = gyro::dcntl[Param::R]; - for (int i = 0; i < u.size(); i++) { - double r_i = r[int(i / theta.size())]; - double theta_i = theta[i % theta.size()]; - double x = gyro::functions->x(r_i, theta_i, kappa_eps, delta_e, Rmax); - double y = gyro::functions->y(r_i, theta_i, kappa_eps, delta_e, Rmax); - f << std::setprecision(17) << r_i << " " << theta_i << " " << x << " " << y << " " << u[i] << "\n"; - } - } - f.close(); -} /* ----- end of level::read_grid ----- */ diff --git a/src/main.cpp b/src/main.cpp index 5e18b313..57f36313 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,485 +1,49 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ +#include -/** - * \file main.cpp - * \brief Test program to launch the application from: - * "Implicitly extrapolated geometric multigrid on disk-like domains for - the gyrokinetic Poisson equation from fusion plasma applications", Martin - Joachim Kühn, Carola Kruse, Ulrich Rüde - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - * \date March 31st 2021 - * - * This program launch the application with the problem and parameters specified in a - * configuration file (first argument or "config_file.info" by default) - * - */ -#include -#include -#include -#include "cmdline.h" -#include "gmgpolar.h" +#include "../include/GMGPolar/gmgpolar.h" -#define ICPU sched_getcpu() -#define NOMP omp_get_num_threads() -#define IOMP omp_get_thread_num() - -/** - * \fn int main () - * \brief Main function - * - * \param 1: configuration file (Optional) - * \return EXIT_SUCCESS - Arrêt normal du programme. - */ int main(int argc, char* argv[]) { -#ifdef GMGPOLAR_USE_LIKWID - LIKWID_MARKER_INIT; +// Display Build Type +#ifdef NDEBUG + std::cout << "Build Type: Release" << std::endl; +#else + std::cout << "Build Type: Debug" << std::endl; #endif - int error = 0; - - //////////////////////////////////////////////////////////////////////////////// - // READING PARAMETERS - //////////////////////////////////////////////////////////////////////////////// - cmdline::parser a; - a.add("optimized", '\0', "", false, 1); - a.add("matrix_free", '\0', "", false, 1); - a.add("debug", 'D', "", false, 0); - a.add("nr_exp", 'n', "", false, 4); - a.add("ntheta_exp", '\0', "", false, 4); - a.add("fac_ani", 'a', "", false, 3); - a.add("v1", '\0', "", false, 1); - a.add("v2", '\0', "", false, 1); - a.add("cycle", 'c', "", false, 1); - a.add("mod_pk", '\0', "", false, 0); - a.add("compute_rho", '\0', "", false, 0); - a.add("level", 'l', "", false, -1); - a.add("maxiter", '\0', "", false, 150); - a.add("theta_aniso", '\0', "", false, 0); - a.add("smoother", '\0', "", false, 3); - a.add("extrapolation", 'E', "", false, 0); - a.add("DirBC_Interior", '\0', "", false, 1); - a.add("divideBy2", '\0', "", false, 0); - a.add("prob", '\0', "", false, 5); - a.add("alpha_coeff", '\0', "", false, 0); - a.add("beta_coeff", '\0', "", false, 0); - a.add("verbose", '\0', "", false, 1); - a.add("openmp", '\0', "", false, 1); - a.add("res_norm", '\0', "", false, 3); - a.add("write_radii_angles", '\0', "", false, 0); - a.add("check_error", '\0', "", false, 1); - - a.add("R0", 'r', "", false, 1e-5); - a.add("R", 'R', "", false, 1.3); - a.add("kappa_eps", 'k', "", false, 42); - a.add("delta_e", 'd', "", false, 42); - a.add("tol_bound_check", 'e', "", false, 1e-8); - a.add("rel_red_conv", '\0', "", false, 1e-8); - - a.add("f_grid_r", '\0', "", false, ""); - a.add("f_grid_theta", '\0', "", false, ""); - a.add("f_sol_in", '\0', "", false, ""); - a.add("f_sol_out", '\0', "", false, ""); - - a.parse_check(argc, argv); - - //std::cout << "Initializing parameters...\n"; - gyro::init_params(); - - gyro::icntl[Param::verbose] = a.get("verbose"); - gyro::icntl[Param::openmp] = a.get("openmp"); - gyro::icntl[Param::optimized] = a.get("optimized"); - gyro::icntl[Param::matrix_free] = a.get("matrix_free"); - gyro::icntl[Param::debug] = a.get("debug"); - // gyro::icntl[Param::divideBy2] = a.get("divideBy2"); - gyro::icntl[Param::smoother] = a.get("smoother"); - gyro::dcntl[Param::rel_red_conv] = a.get("rel_red_conv"); - - gyro::f_grid_r = a.get("f_grid_r"); - gyro::f_grid_theta = a.get("f_grid_theta"); - if (!gyro::f_grid_r.empty() || !gyro::f_grid_theta.empty()) { - std::cout << "File for grid in r: " << gyro::f_grid_r << ", and theta: " << gyro::f_grid_theta << "\n"; - } - gyro::f_sol_in = a.get("f_sol_in"); - gyro::f_sol_out = a.get("f_sol_out"); - if (!gyro::f_sol_in.empty() && gyro::icntl[Param::check_error]) { - std::cout << "Warning: an input solution has been provided but the error will not be checked\n"; - } - else if (!gyro::f_sol_in.empty()) { - std::cout << "File to read the solution vector: " << gyro::f_sol_in << "\n"; - } - if (!gyro::f_sol_out.empty()) { - std::cout << "File to write the solution vector: " << gyro::f_sol_in << "\n"; - } - - //////////////////////////////////////////////////////////////////////////////// - // DISPLAY OPENMP INFO - //////////////////////////////////////////////////////////////////////////////// - //Set number of threads for the openmp parallelization - omp_set_num_threads(gyro::icntl[Param::openmp]); - - if (gyro::icntl[Param::verbose] > 1) { -#pragma omp parallel - { -#pragma omp master - { - std::cout << "Number of OpenMP threads: " << NOMP << "\n"; - } - } - } - if (gyro::icntl[Param::verbose] > 1) { - -#pragma omp parallel - { -#pragma omp master - { - std::cout << "OMP_thread\tCPU\n"; - } -#pragma omp critical - { - std::cout << IOMP << "\t" << ICPU << "\n"; - } - } - std::cout << "\n"; - } - - // normal run, NO DEBUGGING - if (gyro::icntl[Param::debug] == 0) { - gyro::icntl[Param::nr_exp] = a.get("nr_exp"); - gyro::icntl[Param::ntheta_exp] = a.get("ntheta_exp"); - gyro::icntl[Param::fac_ani] = a.get("fac_ani"); - gyro::icntl[Param::v1] = a.get("v1"); - gyro::icntl[Param::v2] = a.get("v2"); - gyro::icntl[Param::cycle] = a.get("cycle"); - gyro::icntl[Param::mod_pk] = a.get("mod_pk"); - if (gyro::icntl[Param::mod_pk] == 42) - gyro::icntl[Param::mod_pk] = 0; - gyro::icntl[Param::compute_rho] = a.get("compute_rho"); - gyro::icntl[Param::level] = a.get("level"); - gyro::icntl[Param::maxiter] = a.get("maxiter"); - gyro::icntl[Param::theta_aniso] = a.get("theta_aniso"); - gyro::icntl[Param::extrapolation] = a.get("extrapolation"); - gyro::icntl[Param::DirBC_Interior] = a.get("DirBC_Interior"); - gyro::icntl[Param::divideBy2] = a.get("divideBy2"); - gyro::icntl[Param::prob] = a.get("prob"); - gyro::icntl[Param::alpha_coeff] = a.get("alpha_coeff"); - gyro::icntl[Param::beta_coeff] = a.get("beta_coeff"); - gyro::icntl[Param::res_norm] = a.get("res_norm"); - gyro::icntl[Param::write_radii_angles] = a.get("write_radii_angles"); - gyro::icntl[Param::check_error] = a.get("check_error"); - if (gyro::icntl[Param::extrapolation] >= 2 && gyro::icntl[Param::check_error] == 0) { - throw std::runtime_error("The alternative extrapolation technique requires to check the error, w.r.t. to " - "the theoretical solution, as stopping criterion."); - } - - gyro::dcntl[Param::R0] = a.get("R0"); - gyro::dcntl[Param::R] = a.get("R"); - gyro::dcntl[Param::kappa_eps] = a.get("kappa_eps"); - gyro::dcntl[Param::delta_e] = a.get("delta_e"); - - geometry_type geom = (geometry_type)gyro::icntl[Param::mod_pk]; - if (gyro::dcntl[Param::kappa_eps] == 42 && gyro::dcntl[Param::delta_e] == 42) { - gyro::get_geometry_coeffs(geom); - } - if (gyro::icntl[Param::verbose] > 2) - gyro::show_params(); - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], gyro::icntl[Param::beta_coeff], - gyro::icntl[Param::mod_pk], gyro::icntl[Param::prob]); - - //////////////////////////////////////////////////////////////////////////////// - // LAUNCH - //////////////////////////////////////////////////////////////////////////////// - double t; - TIC; - gmgpolar gmg; - try { - // Create polar grids - gmg.create_grid_polar(); - - if (gyro::icntl[Param::write_radii_angles] == 0) - // Solve using multigrid - gmg.polar_multigrid(); - } - catch (std::runtime_error const& e) { - std::cout << "Error code : " << e.what() << "\n"; - } - catch (...) { - std::cout - << "I felt a great disturbance in the Force, as if millions of voices suddenly cried out in terror " - "and were suddenly silenced. I fear something terrible has happened.\n"; - error = 1; - } - // if (gyro::icntl[Param::verbose] > 0) - std::cout << "Total execution time: " << TOC - << "\n---------------------------------------------------------------------------\n"; - } - - // DEBUGGING - else { - geometry_type geom; - clock_t t; - //////////////////////////////////////////////////////////////////////////////// - // LOOP PARAMETERS - //////////////////////////////////////////////////////////////////////////////// - // debug=1 - // nr_exp=4 - // ntheta_exp=4 - // fac_ani=3 - // divideBy2=0 - gyro::icntl[Param::nr_exp] = 4; - gyro::icntl[Param::ntheta_exp] = 4; - gyro::icntl[Param::fac_ani] = 3; - gyro::icntl[Param::divideBy2] = 0; - gyro::icntl[Param::verbose] = 0; - std::cout << "####################################################\n"; - std::cout << "GLOBAL PARAMETERS // nr_exp" << gyro::icntl[Param::nr_exp] - << ", ntheta_exp: " << gyro::icntl[Param::ntheta_exp] << ", fac_ani: " << gyro::icntl[Param::fac_ani] - << ", divideBy2: " << gyro::icntl[Param::divideBy2] << ", verbose: " << gyro::icntl[Param::verbose] - << "\n"; - std::cout << "####################################################\n"; - - // prob5+R1+mod_pk2+alpha1+beta1+optimized1+DirBC_Interior1+smoother3+extrapolation1: 1 - gyro::icntl[Param::prob] = 5; - gyro::dcntl[Param::R] = 1.0; - gyro::icntl[Param::mod_pk] = 2; - gyro::icntl[Param::alpha_coeff] = 1; - gyro::icntl[Param::beta_coeff] = 1; - gyro::icntl[Param::optimized] = 1; - gyro::icntl[Param::DirBC_Interior] = 1; - gyro::icntl[Param::smoother] = 3; - gyro::icntl[Param::extrapolation] = 1; - std::cout << "#################################################################################################" - "#######\n"; - std::cout << "TESTING DEFAULT CASE // prob" << gyro::icntl[Param::prob] << ", R: " << gyro::dcntl[Param::R] - << ", mod_pk: " << gyro::icntl[Param::mod_pk] << ", alpha_coeff: " << gyro::icntl[Param::alpha_coeff] - << ", beta_coeff: " << gyro::icntl[Param::beta_coeff] << ", optimized" - << gyro::icntl[Param::optimized] << ", DirBC_Interior: " << gyro::icntl[Param::DirBC_Interior] - << ", smoother: " << gyro::icntl[Param::smoother] - << ", extrapolation: " << gyro::icntl[Param::extrapolation] << "\n"; - std::cout << "#################################################################################################" - "#######\n"; - geom = (geometry_type)gyro::icntl[Param::mod_pk]; - gyro::get_geometry_coeffs(geom); - if (gyro::icntl[Param::verbose] > 2) - gyro::show_params(); - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], gyro::icntl[Param::beta_coeff], - gyro::icntl[Param::mod_pk], gyro::icntl[Param::prob]); - //////////////////////////////////////////////////////////////////////////////// - // LAUNCH - //////////////////////////////////////////////////////////////////////////////// - TIC; - gmgpolar gmg; - try { -#ifdef GMGPOLAR_USE_LIKWID -#pragma omp parallel -{ - LIKWID_MARKER_START("create_grid_polar"); -} -#endif - // Create polar grids - gmg.create_grid_polar(); -#ifdef GMGPOLAR_USE_LIKWID -#pragma omp parallel -{ - LIKWID_MARKER_STOP("create_grid_polar"); -} +// Check Likwid Status +#ifdef GMGPOLAR_USE_LIKWID + std::cout << "Likwid: ON" << std::endl; +#else + std::cout << "Likwid: OFF" << std::endl; #endif - // Solve using multigrid - gmg.polar_multigrid(); - } - catch (std::runtime_error const& e) { - std::cout << "Error code : " << e.what() << "\n"; - exit(1); - } - catch (...) { - std::cout << "I felt a great disturbance in the Force, as if millions of voices suddenly " - "cried out " - "in terror " - "and were suddenly silenced. I fear something terrible has happened.\n"; - error = 1; - } - if (gyro::icntl[Param::verbose] > 0) - std::cout << "Total execution time: " << TOC << "\n"; - - std::cout << "\n\n\n\n\n"; - // prob5+R1+mod_pk2+alpha1+beta1: 6 - // optimized=0-1 - // DirBC_Interior=0-1 - // smoother=3,13 - // extrapolation=0-1 - gyro::icntl[Param::prob] = 5; - gyro::dcntl[Param::R] = 1.0; - gyro::icntl[Param::mod_pk] = 2; - gyro::icntl[Param::alpha_coeff] = 1; - gyro::icntl[Param::beta_coeff] = 1; - std::cout << "#################################################################################################" - "#######\n"; - std::cout << "TESTING MG PARAMETERS // prob" << gyro::icntl[Param::prob] << ", R: " << gyro::dcntl[Param::R] - << ", mod_pk: " << gyro::icntl[Param::mod_pk] << ", alpha_coeff: " << gyro::icntl[Param::alpha_coeff] - << ", beta_coeff: " << gyro::icntl[Param::beta_coeff] << "\n"; - std::cout << "#################################################################################################" - "#######\n"; - // for (int optimized = 0; optimized < 2; optimized++) { - for (int DirBC_Interior = 0; DirBC_Interior < 2; DirBC_Interior++) { - // for (int smoother = 3; smoother < 23; smoother += 10) { - for (int extrapolation = 0; extrapolation < 2; extrapolation++) { - // // int optimized = 1; - // int DirBC_Interior = 0; - // // int smoother = 3; - // int extrapolation = 1; - // gyro::icntl[Param::optimized] = optimized; - gyro::icntl[Param::DirBC_Interior] = DirBC_Interior; - // gyro::icntl[Param::smoother] = smoother; - gyro::icntl[Param::extrapolation] = extrapolation; - - geom = (geometry_type)gyro::icntl[Param::mod_pk]; - gyro::get_geometry_coeffs(geom); - if (gyro::icntl[Param::verbose] > 2) - gyro::show_params(); - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], gyro::icntl[Param::beta_coeff], - gyro::icntl[Param::mod_pk], gyro::icntl[Param::prob]); - std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; - // std::cout << "opti: " << optimized << ", BC: " << DirBC_Interior << ", smoother: " << smoother - // << ", extrap: " << extrapolation << "\n"; - std::cout << "BC: " << DirBC_Interior << ", extrap: " << extrapolation << "\n"; - std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; - - //////////////////////////////////////////////////////////////////////////////// - // LAUNCH - //////////////////////////////////////////////////////////////////////////////// - TIC; - gmgpolar gmg2; - try { - // Create polar grids - gmg2.create_grid_polar(); - - // Solve using multigrid - gmg2.polar_multigrid(); - } - catch (std::runtime_error const& e) { - std::cout << "Error code : " << e.what() << "\n"; - exit(1); - } - catch (...) { - std::cout << "I felt a great disturbance in the Force, as if millions of voices suddenly " - "cried out " - "in terror " - "and were suddenly silenced. I fear something terrible has happened.\n"; - error = 1; - } - if (gyro::icntl[Param::verbose] > 0) - std::cout << "Total execution time: " << TOC << "\n"; - } - // } - } - // } - - std::cout << "\n\n\n\n\n"; +// Check MUMPS Status +#ifdef GMGPOLAR_USE_MUMPS + std::cout << "MUMPS: ON\n" << std::endl; +#else + std::cout << "MUMPS: OFF\n" << std::endl; +#endif - // optimized1+DirBC_Interior1+smoother3+extrapolation1: 32 - // R=1.0,1.3 - // prob=5-6 - // mod_pk=0-2(3) - // alpha_coeff=0-1 - // beta_coeff=0-1 - gyro::icntl[Param::optimized] = 1; - gyro::icntl[Param::DirBC_Interior] = 1; - gyro::icntl[Param::smoother] = 3; - gyro::icntl[Param::extrapolation] = 1; - std::cout << "#################################################################################################" - "#######\n"; - std::cout << "TESTING TEST CASES // optimized" << gyro::icntl[Param::optimized] - << ", DirBC_Interior: " << gyro::icntl[Param::DirBC_Interior] - << ", smoother: " << gyro::icntl[Param::smoother] - << ", extrapolation: " << gyro::icntl[Param::extrapolation] << "\n"; - std::cout << "#################################################################################################" - "#######\n"; - for (double R = 1.0; R < 1.6; R += 0.3) { - for (int prob = 5; prob < 7; prob++) { - for (int mod_pk = 0; mod_pk < 3; mod_pk++) { - for (int alpha_coeff = 0; alpha_coeff < 2; alpha_coeff++) { - for (int beta_coeff = 0; beta_coeff < 2; beta_coeff++) { - // double R = 1.0; - // int prob = 5; - // int mod_pk = 1; - // int alpha_coeff = 1; - // int beta_coeff = 1; - gyro::dcntl[Param::R] = R; - gyro::icntl[Param::prob] = prob; - gyro::icntl[Param::mod_pk] = mod_pk; - gyro::icntl[Param::alpha_coeff] = alpha_coeff; - gyro::icntl[Param::beta_coeff] = beta_coeff; + // Initialize LIKWID markers if enabled + LIKWID_INIT(); - geom = (geometry_type)gyro::icntl[Param::mod_pk]; - gyro::get_geometry_coeffs(geom); - if (gyro::icntl[Param::verbose] > 2) - gyro::show_params(); - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], - gyro::icntl[Param::beta_coeff], gyro::icntl[Param::mod_pk], - gyro::icntl[Param::prob]); - std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; - std::cout << "R: " << R << ", prob: " << prob << ", mod_pk: " << mod_pk - << ", alpha_coeff: " << alpha_coeff << ", beta_coeff: " << beta_coeff << "\n"; - std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + // Initialize solver and set parameters from command-line arguments + GMGPolar solver; + solver.setParameters(argc, argv); + // Run Solver Setup with optional LIKWID markers + solver.setup(); + // Execute Solve Phase with optional LIKWID markers + solver.solve(); - //////////////////////////////////////////////////////////////////////////////// - // LAUNCH - //////////////////////////////////////////////////////////////////////////////// - TIC; - gmgpolar gmg3; - try { - // Create polar grids - gmg3.create_grid_polar(); + // Finalize LIKWID markers if enabled + LIKWID_CLOSE(); - // Solve using multigrid - gmg3.polar_multigrid(); - } - catch (std::runtime_error const& e) { - std::cout << "Error code : " << e.what() << "\n"; - exit(1); - } - catch (...) { - std::cout - << "I felt a great disturbance in the Force, as if millions of voices suddenly " - "cried out " - "in terror " - "and were suddenly silenced. I fear something terrible has happened.\n"; - error = 1; - } - if (gyro::icntl[Param::verbose] > 0) - std::cout << "Total execution time: " << TOC << "\n"; - } - } - } - } - } - } + // Retrieve and print solution and timings + Vector& solution = solver.solution(); + const PolarGrid& grid = solver.grid(); -#ifdef GMGPOLAR_USE_LIKWID - LIKWID_MARKER_CLOSE; -#endif + solver.printTimings(); - return error; -} /* ----- end of main ----- */ + return 0; +} diff --git a/src/multigrid_iter.cpp b/src/multigrid_iter.cpp deleted file mode 100644 index 4e5b960e..00000000 --- a/src/multigrid_iter.cpp +++ /dev/null @@ -1,910 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file multigrid_iter.cpp - * \brief Implementation of the multigrid scheme - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ - -#include "gmgpolar.h" -#include - -/*! - * \brief The multigrid cycle iterations - * - * The multigrid cycle iterations: calls gmgpolar::multigrid_iter_extrapol() - * - */ -void gmgpolar::multigrid_iter() -{ - double t; - TIC; - - int extrapol = gyro::icntl[Param::extrapolation]; - int nrm_res = gyro::icntl[Param::res_norm]; - - if (extrapol > 0) - v_level[1]->fVec_initial = v_level[1]->fVec; //Extrapolation: store the initial fVec on level 1 - if (gyro::icntl[Param::verbose] > 0) { - if (extrapol == 1) - std::cout << "with implicit extrapolation.\n"; - else if (extrapol == 2) - std::cout << "with alternative extrapolation.\n WARNING: Alternative extrapolation option is a pure test or research setting.\n"; - } - - int it = 0; - v_level[0]->u.assign(v_level[0]->m, 0); //zero u on level 0 (only once at the beginning) - - TIC; - - if (extrapol < 2) { - - //! compute the initial residual: res0 = f - A*u - compute_residual(0, extrapol); //compute residual on level 0 - //compute the 2 norm and inf-norm of the residual - nrm_2_res.push_back(0); //2norm of residual, store the residual norm on level 0 of every iteration - nrm_inf_res.push_back(0); - double nrm_inf_err_temp = 0; - - for (long unsigned int i = 0; i < v_level[0]->res.size(); ++i) { - nrm_2_res[0] += v_level[0]->res[i] * v_level[0]->res[i]; - - if (fabs(v_level[0]->res[i]) > nrm_inf_err_temp) { - nrm_inf_err_temp = fabs(v_level[0]->res[i]); - } - } - nrm_2_res[0] = sqrt(nrm_2_res[0]); - nrm_inf_res[0] = nrm_inf_err_temp; - - if (gyro::icntl[Param::verbose] > 0) { - std::cout << "initial residual: 2-norm = " << nrm_2_res[0] << "\n"; - std::cout << "initial residual: inf-norm = " << nrm_inf_res[0] << "\n"; - } - } - //ALternative extrapolation - else { - if (gyro::icntl[Param::check_error] == 0) - throw std::runtime_error("The alternative extrapolation technique requires to check the error, w.r.t. to " - "the theoretical solution, as stopping criterion."); - //! compute the initial error - std::vector error = compute_error(); - nrm_2_err.push_back(0); - for (std::size_t i = 0; i < error.size(); ++i) { //iterate over the grid in polar coordinates - nrm_2_err[0] += error[i] * error[i]; - } - nrm_2_err[0] = sqrt(nrm_2_err[0]) / sqrt(v_level[0]->m); //scaling by 1/sqrt(m) - if (gyro::icntl[Param::verbose] > 0) - std::cout << "initial error: 2-norm = " << nrm_2_err[0] << "\n"; - } - - double rel_red_conv = gyro::dcntl[Param::rel_red_conv]; //threshold on relative residual - double convergence_criterium = 1.0; - - t_fine_residual += TOC; - TIC; - -#ifdef GMGPOLAR_USE_LIKWID -#pragma omp parallel -{ - LIKWID_MARKER_START("Iteration"); -} -#endif - //! Start the Multigrid-Iteration - while (it < gyro::icntl[Param::maxiter] && convergence_criterium > rel_red_conv) { - it++; - - //call the multigrid_cycle on level 0 (the finest level) - multigrid_cycle_extrapol(0); - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(v_level[0]->u, "u"); - - TIC; - //---------------------------------------------------------------------------------------------------------- - //! compute the convergence criterium - //use the residual as convergence criterium - if (extrapol < 2) { - gmgpolar::compute_residual(0, extrapol); //compute residual on level 0 - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(v_level[0]->res, "res"); - - nrm_2_res.push_back(0); - nrm_inf_res.push_back(0); - double nrm_inf_res_temp = 0; - - for (unsigned long int i = 0; i < v_level[0]->res.size(); ++i) { - nrm_2_res[it] += v_level[0]->res[i] * v_level[0]->res[i]; - - if (fabs(v_level[0]->res[i]) > nrm_inf_res_temp) { - nrm_inf_res_temp = fabs(v_level[0]->res[i]); - } - } - nrm_2_res[it] = sqrt(nrm_2_res[it]); - nrm_inf_res[it] = nrm_inf_res_temp; - - // * Defines the norm used for the residual in the stopping criterion - // * 0: - // * 1: - // * 2: - // * 3: - if (nrm_res == 0) { // L2 norm scaled by initial res. - convergence_criterium = nrm_2_res[it] / nrm_2_res[0]; - } - else if (nrm_res == 1) { // Infinitiy norm scaled by initial res. - convergence_criterium = nrm_inf_res[it] / nrm_inf_res[0]; - } - else if (nrm_res == 2) { // L2 norm - convergence_criterium = nrm_2_res[it]; - } - else if (nrm_res == 3) { // Infinitiy norm - convergence_criterium = nrm_inf_res[it]; - } - - if (gyro::icntl[Param::verbose] > 1) - std::cout << "--> Iteration " << it << ": residual norm = " << nrm_2_res[it] - << ", relative residual = " << convergence_criterium << std::endl; - } - //Alternative extrapolation: use error instead of residual as convergence criterium - else { - if (gyro::icntl[Param::check_error] == 0) - throw std::runtime_error( - "The alternative extrapolation technique requires to check the error, w.r.t. to " - "the theoretical solution, as stopping criterion."); - - std::vector error = compute_error(); - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(error, "error"); - - nrm_2_err.push_back(0); - for (std::size_t i = 0; i < error.size(); ++i) { //iterate over the grid in polar coordinates - nrm_2_err[it] += error[i] * error[i]; - } - nrm_2_err[it] = sqrt(nrm_2_err[it]) / sqrt(v_level[0]->m); //scaling by 1/sqrt(m) - - double error_difference = fabs(nrm_2_err[it] - nrm_2_err[it - 1]); - convergence_criterium = error_difference / nrm_2_err[0]; - - if (gyro::icntl[Param::verbose] > 1) - std::cout << "--> Iteration " << it << ": error norm = " << nrm_2_err[it] - << ", relative error = " << convergence_criterium << std::endl; - } - t_fine_residual += TOC; - TIC; - } -#ifdef GMGPOLAR_USE_LIKWID -#pragma omp parallel -{ - LIKWID_MARKER_STOP("Iteration"); -} -#endif - if (gyro::icntl[Param::verbose] > 0) { - if (it == gyro::icntl[Param::maxiter]) { - std::cout << "Multigrid reached maxiter=" << gyro::icntl[Param::maxiter] << "\n"; - } - else { - std::cout << "Convergence after iteration " << it << std::endl; - } - } - //---------------------------------------------------------------------------------------------------------- - //!compute mean residual reduction factor rho - if (extrapol < 2) { - double rho_mean = std::pow(convergence_criterium, 1.0 / it); //take the it-th root (it=number of iterations) - std::cout << "mean residual reduction factor: rho = " << rho_mean << std::endl; - } - - if (!gyro::f_sol_out.empty()) { - v_level[0]->write_sol(); - } - - TIC; - if (gyro::icntl[Param::check_error] == 1) { - //compute the error in the 2-norm and inf-norm - std::vector error = compute_error(); - double nrm_inf_err = 0; - double nrm_2 = 0; - for (std::size_t i = 0; i < error.size(); ++i) { //iterate over the grid in polar coordinates - nrm_2 += error[i] * error[i]; - if (fabs(error[i]) > nrm_inf_err) { - nrm_inf_err = fabs(error[i]); - } - } - nrm_2 = sqrt(nrm_2) / sqrt(v_level[0]->m); //scaling by 1/sqrt(m) - - if (gyro::icntl[Param::verbose] > 0) { - std::cout << "2-norm of error = " << nrm_2 << std::endl; - std::cout << "inf-norm of error = " << nrm_inf_err << std::endl; - } - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(error, "error"); - } - - t_error += TOC; - TIC; - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(v_level[0]->u, "u"); -} /* ----- end of gmgpolar::multigrid_iter ----- */ - -/*! - * \brief Multigrid iterations on level l - * - * Multigrid iterations on level l - * - * \param l: the level (0=finest) - * - */ -void gmgpolar::multigrid_cycle_extrapol(int l) -{ - //l = current level we are on (from class level) - if (gyro::icntl[Param::verbose] > 4) { - std::cout << "********************************************" << std::endl; - std::cout << "MULTIGRID ON LEVEL " << l << std::endl; - std::cout << "nr = " << v_level[l]->nr << ", ntheta = " << v_level[l]->ntheta << std::endl; - std::cout << "********************************************" << std::endl; - } - - //time measuring - double t, t_total_tmp, t_smoothing_tmp; - TIC; - t_total_tmp = t; - t_smoothing_tmp = t; - - int extrapol = gyro::icntl[Param::extrapolation]; - int s = 0; - int c = 0; - int smoother = 0; - std::vector> f_Asc_u = std::vector>(4, std::vector()); - - TIC; - //! v1 presmoothing steps (on level l) - for (int v = 0; v < gyro::icntl[Param::v1]; ++v) { - for (smoother = 0; smoother < 4; smoother++) { - int size = 0, size_ortho = 0; - if (smoother < 2) { - size_ortho = v_level[l]->delete_circles + 1; - size = v_level[l]->delete_circles; - } - else if (smoother > 1) { - size_ortho = v_level[l]->ntheta_int; - size = v_level[l]->ntheta_int; - } - for (int i = 0; i < size_ortho; i++) - v_level[l]->dep_Asc_ortho[smoother][i] = 0; - for (int i = 0; i < size; i++) - v_level[l]->dep_Asc[smoother][i] = 0; - } - - if (gyro::icntl[Param::optimized] == 0) { - // iterate over the 4 smoothers (0:c/b, 1:c/w, 2:r/b, 3:r/w) - for (int smoother = 0; smoother < 4; smoother++) { - TIC; - - //call the smooothing function, the result is u_sc which is directly inserted into u - v_level[l]->multigrid_smoothing0(smoother); - - if (gyro::icntl[Param::verbose] > 4) - std::cout << "Finishing running of pre-smoother: " << smoother << " (" << TOC << " s)\n"; - } - } - else { - // Initialize vectors to contain Asc_ortho.u (required for OpenMP, else adresses change between threads) - for (smoother = 0; smoother < 4; smoother++) - f_Asc_u[smoother] = std::vector(v_level[l]->nblocks[smoother] * v_level[l]->m_sc[smoother], 0); - - //call the smooothing function, the result is u_sc which is directly inserted into u -#pragma omp parallel firstprivate(v, s, c, smoother) shared(f_Asc_u) - { -#pragma omp single - { - for (s = 0; s < 2; s++) { - // iterate over the 4 smoothers (0:c/b, 1:c/w, 2:r/b, 3:r/w) - for (c = 0; c < 2; c++) { - int smoother = s * 2 + c; - TIC; - int sm = (smoother < 2) ? 1 - smoother : 5 - smoother; - v_level[l]->multigrid_smoothing( - smoother, v, f_Asc_u[smoother], v_level[l]->nblocks[smoother], c, - v_level[l]->dep_Asc[smoother], v_level[l]->dep_Asc[sm], v_level[l]->dep_Asc[1], - v_level[l]->dep_Asc_ortho[smoother]); - - if (gyro::icntl[Param::verbose] > 4) - std::cout << "Finishing running of pre-smoother: " << smoother << " (" << TOC << " s)\n"; - } - } - } // omp single - } // omp parallel - } - - if (gyro::icntl[Param::smoother] == 13) { - //create the current solution u from the two vectors u_previous - //int number_circle_points = v_level[l]->m_sc[0] + v_level[l]->m_sc[1]; //does not work for extrapolation - int number_circle_points = v_level[l]->delete_circles * v_level[l]->ntheta; - for (int i = 0; i < number_circle_points; ++i) { - v_level[l]->u[i] = v_level[l]->u_previous_c[i]; //insert values from the circle smoother - } - for (int i = number_circle_points; i < v_level[l]->m; ++i) { - v_level[l]->u[i] = v_level[l]->u_previous_r[i]; //insert values from the radial smoother - } - } - } - //std::cout << "pre-smoothing done \n"; - - t = t_smoothing_tmp; - t_smoothing += TOC; - - if (gyro::icntl[Param::verbose] > 5){ // no timing of large output - gyro::disp(v_level[l]->u, "u"); - } - - TIC; - - //! compute residual (of level l) - //even if we have extrapolation, compute just normal residual (extrapolation-restriction follows in the next step) - gmgpolar::compute_residual(l, 0); - - t_residual += TOC; - - if (gyro::icntl[Param::verbose] > 5){ // no timing of large output - gyro::disp(v_level[l]->res, "res"); - } - - TIC; - - //! Restriction of residual (coarsening) - //the restricted residual of level l becomes the right hand side on level l+1, f(l+1)=res_coarse(l) - if (extrapol > 0 && l == 0) { //for extrapol = 1 and extrapol = 2 - std::vector res_1; - //res_1 = P_ex^T * res - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - res_1 = v_level[l]->apply_prolongation_ex0(v_level[l]->res, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 1); - } - else { - res_1 = v_level[l]->apply_restriction_ex(v_level[l]->res); - } - } - else { - res_1 = std::vector(v_level[l]->mc, 0); - for (size_t i = 0; i < v_level[l]->ri_prol_ex.size(); i++) { - res_1[v_level[l]->ci_prol_ex[i]] += - v_level[l]->v_prol_ex[i] * v_level[l]->res[v_level[l]->ri_prol_ex[i]]; - } - } - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(res_1, "res_1"); - - //Au_coarse = A(l+1) * u_coarse = A(l+1) * P_inj^T * u(l) - std::vector Au_coarse(v_level[l + 1]->m, 0); //result of apply_A(u_coarse), empty vector - - std::vector u_coarse; - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - u_coarse = v_level[l]->apply_prolongation_inj0(v_level[l]->u, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 1); - } - else { - u_coarse = v_level[l]->apply_restriction_inj(v_level[l]->u); - } - } - else { - u_coarse = std::vector(v_level[l]->mc, 0); - for (size_t i = 0; i < v_level[l]->ri_prol_inj.size(); i++) { - u_coarse[v_level[l]->ci_prol_inj[i]] += - v_level[l]->v_prol_inj[i] * v_level[l]->u[v_level[l]->ri_prol_inj[i]]; - } - } - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(u_coarse, "u_coarse"); - - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) - { - v_level[l + 1]->apply_A0(u_coarse, Au_coarse); - }else{ - double start = omp_get_wtime(); - v_level[l + 1]->apply_A(u_coarse, Au_coarse); - double end = omp_get_wtime(); - t_applyA += (end - start); - } - } - else { - if (gyro::icntl[Param::openmp] == 1) { - for (size_t i = 0; i < v_level[l + 1]->row_indices.size(); i++) { - Au_coarse[v_level[l + 1]->row_indices[i]] += - v_level[l + 1]->vals[i] * u_coarse[v_level[l + 1]->col_indices[i]]; - } - } - else { - int j; -#pragma omp parallel for private(j) firstprivate(u_coarse) shared(Au_coarse) - for (j = 0; j < v_level[l + 1]->nr; j++) { - std::vector ptr_vect = v_level[l + 1]->get_ptr(j); - int ptr_start = ptr_vect[1]; - int ptr_end = ptr_start + (ptr_vect[2] - ptr_vect[1]) * v_level[l + 1]->ntheta_int; - for (int k = ptr_start; k < ptr_end; k++) { - Au_coarse[v_level[l + 1]->row_indices[k]] += - v_level[l + 1]->vals[k] * u_coarse[v_level[l + 1]->col_indices[k]]; - } - } - } - } - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(Au_coarse, "Au_coarse"); - - // f(l+1) = 4/3 * res_1 - 1/3 * (f(l+1) - Au_coarse) - for (unsigned long int i = 0; i < res_1.size(); ++i) { - v_level[l + 1]->fVec[i] = 4. / 3. * res_1[i] - 1. / 3. * (v_level[l + 1]->fVec_initial[i] - Au_coarse[i]); - } - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(v_level[l + 1]->fVec, "fVec"); - } - else { //no extrapolation - //res(l+1)=P^T*res(l) //trans=1 (Restriction, P^T) - //P=(ncoarse*mc), ncoarse=m(size of fine level), mc(size of coarse level), coarse_r=coarse_nodes_list_r - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) - v_level[l + 1]->fVec = v_level[l]->apply_prolongation_bi0( - v_level[l]->res, v_level[l]->mc, v_level[l]->m, v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 1); - else - v_level[l + 1]->fVec = v_level[l]->apply_restriction_bi(v_level[l]->res); - } - else { - v_level[l + 1]->fVec = std::vector(v_level[l]->mc, 0); - for (size_t i = 0; i < v_level[l]->ri_prol.size(); i++) { - v_level[l + 1]->fVec[v_level[l]->ci_prol[i]] += - v_level[l]->v_prol[i] * v_level[l]->res[v_level[l]->ri_prol[i]]; - } - } - } - //std::cout << "residual restricted \n"; - t_restriction += TOC; - TIC; - - //! recursive call of multigrid_cycle_extrapol - v_level[l + 1]->u.assign(v_level[l + 1]->m, 0); // zero u in every iteration - std::vector error_coarse; - if (l == levels - 2) { - // exact solve on the coarsest level for the error (A * error = res) (use whole A from coarsest level) - // check for the second to coarsest level (levels-2), as no smoothing on the coarsest level exists - // (and thus no Asc and no Asc_ortho) -#ifdef GMGPOLAR_USE_MUMPS - if (gyro::icntl[Param::optimized] == 0) { -#endif - error_coarse = v_level[l + 1]->solve_gaussian_elimination( - v_level[l + 1]->row_Ac_LU, v_level[l + 1]->col_Ac_LU, v_level[l + 1]->vals_Ac_LU, v_level[l + 1]->fVec); -#ifdef GMGPOLAR_USE_MUMPS - } - else - error_coarse = v_level[l + 1]->solve_mumps(v_level[l + 1]->mumps_Ac, v_level[l + 1]->fVec); -#endif - t_Ac += TOC; - TIC; - } - else { - multigrid_cycle_extrapol(l + 1); - error_coarse = v_level[l + 1]->u; // the coarse_error on level l is u on level l+1 - TIC; - } - - if (gyro::icntl[Param::verbose] > 4) { - std::cout << "********************************************" << std::endl; - std::cout << "BACK ON LEVEL " << l << std::endl; - std::cout << "********************************************" << std::endl; - } - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(error_coarse, "error_coarse"); - - TIC; - //! Prolongation of error_coarse to error_fine - //error(l) = P * error(l+1) - std::vector error_fine; - if (extrapol > 0 && l == 0) { //for extrapol = 1 and extrapol = 2 - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - error_fine = v_level[l]->apply_prolongation_ex0(error_coarse, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - } - else { - error_fine = v_level[l]->apply_prolongation_ex(error_coarse); - } - } - else { - error_fine = std::vector(v_level[l]->m, 0); - for (size_t i = 0; i < v_level[l]->ri_prol_ex.size(); i++) { - error_fine[v_level[l]->ri_prol_ex[i]] += - v_level[l]->v_prol_ex[i] * error_coarse[v_level[l]->ci_prol_ex[i]]; - } - } - } - else { //no extrapolation - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) - error_fine = v_level[l]->apply_prolongation_bi0(error_coarse, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - else - error_fine = v_level[l]->apply_prolongation_bi(error_coarse); - } - else { - error_fine = std::vector(v_level[l]->m, 0); - for (size_t i = 0; i < v_level[l]->ri_prol.size(); i++) { - error_fine[v_level[l]->ri_prol[i]] += v_level[l]->v_prol[i] * error_coarse[v_level[l]->ci_prol[i]]; - } - } - } - //std::cout << "error prolongated \n"; - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(error_fine, "error_fine"); - - //! correction of solution (on level l) - //u += error - for (long unsigned int i = 0; i < error_fine.size(); ++i) { - v_level[l]->u[i] += error_fine[i]; - } - //std::cout << "solution corrected \n"; - t_prolongation += TOC; - TIC; - - t_smoothing_tmp = t; - - //! v2 postsmoothing steps (on level l) - for (int v = 0; v < gyro::icntl[Param::v2]; ++v) { - for (int smoother = 0; smoother < 4; smoother++) { - int size = 0, size_ortho = 0; - if (smoother < 2) { - size_ortho = v_level[l]->delete_circles + 1; - size = v_level[l]->delete_circles; - } - else if (smoother > 1) { - size_ortho = v_level[l]->ntheta_int; - size = v_level[l]->ntheta_int; - } - for (int i = 0; i < size_ortho; i++) - v_level[l]->dep_Asc_ortho[smoother][i] = 0; - for (int i = 0; i < size; i++) - v_level[l]->dep_Asc[smoother][i] = 0; - } - - //std::cout << "smoothing ... \n"; - if (gyro::icntl[Param::optimized] == 0) { - // iterate over the 4 smoothers (0:c/b, 1:c/w, 2:r/b, 3:r/w) - for (int smoother = 0; smoother < 4; smoother++) { - TIC; - - //call the smooothing function, the result is u_sc which is directly inserted into u - v_level[l]->multigrid_smoothing0(smoother); - - if (gyro::icntl[Param::verbose] > 4) - std::cout << "Finishing running of post-smoother: " << smoother << " (" << TOC << " s)\n"; - } - } - else { - // Initialize vectors to contain Asc_ortho.u (required for OpenMP, else adresses change between threads) - for (smoother = 0; smoother < 4; smoother++) - f_Asc_u[smoother] = std::vector(v_level[l]->nblocks[smoother] * v_level[l]->m_sc[smoother], 0); - - //call the smooothing function, the result is u_sc which is directly inserted into u -#pragma omp parallel firstprivate(v, s, c, smoother) shared(f_Asc_u) - { -#pragma omp single - { - for (s = 0; s < 2; s++) { - // iterate over the 4 smoothers (0:c/b, 1:c/w, 2:r/b, 3:r/w) - for (c = 0; c < 2; c++) { - int smoother = s * 2 + c; - TIC; - int sm = (smoother < 2) ? 1 - smoother : 5 - smoother; - v_level[l]->multigrid_smoothing( - smoother, v, f_Asc_u[smoother], v_level[l]->nblocks[smoother], c, - v_level[l]->dep_Asc[smoother], v_level[l]->dep_Asc[sm], v_level[l]->dep_Asc[1], - v_level[l]->dep_Asc_ortho[smoother]); - - if (gyro::icntl[Param::verbose] > 4) - std::cout << "Finishing running of post-smoother: " << smoother << " ( " << TOC << " s)\n"; - } - } - } // omp single - } // omp parallel - } - } - //std::cout << "post-smoothing done \n"; - t = t_smoothing_tmp; - t_smoothing += TOC; - TIC; - - t = t_total_tmp; - t_total_mgcycle += TOC; - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(v_level[l]->u, "u"); -} /* ----- end of gmgpolar::multigrid_cycle_extrapol ----- */ - -/*! - * \brief Computes the residual - * - * Computes the residual based on the approximation res = b-Au - * - * \param l: the level (0=finest) - * \param extrapol: l==0 and gyro::icntl[Param::extrapolation] - * - */ -void gmgpolar::compute_residual(int l, int extrapol) -{ - //std::cout << "compute residual function" << std::endl; - - //compute Au = A*u - std::vector Au(v_level[l]->m, 0); - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) - v_level[l]->apply_A0(v_level[l]->u, Au); - else { - double start = omp_get_wtime(); - v_level[l]->apply_A(v_level[l]->u, Au); - double end = omp_get_wtime(); - t_applyA += (end - start); - } - } - else { - if (gyro::icntl[Param::openmp] == 1) { - for (size_t i = 0; i < v_level[l]->row_indices.size(); i++) { - Au[v_level[l]->row_indices[i]] += v_level[l]->vals[i] * v_level[l]->u[v_level[l]->col_indices[i]]; - } - } - else { - int j; -#pragma omp parallel for private(j) shared(Au) - for (j = 0; j < v_level[l]->nr; j++) { - std::vector ptr_vect = v_level[l]->get_ptr(j); - int ptr_start = ptr_vect[1]; - int ptr_end = ptr_start + (ptr_vect[2] - ptr_vect[1]) * v_level[l]->ntheta_int; - for (int k = ptr_start; k < ptr_end; k++) { - Au[v_level[l]->row_indices[k]] += v_level[l]->vals[k] * v_level[l]->u[v_level[l]->col_indices[k]]; - } - } - } - } - - //set res(l) = f(l) - v_level[l]->res = v_level[l]->fVec; - - //Extrapolation (extrapol = 1) - if (extrapol == 1) { - //apply P to f(l+1): Pf = prolong_inj * f(l+1) - std::vector Pf; - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - Pf = v_level[l]->apply_prolongation_inj0(v_level[l + 1]->fVec_initial, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - } - else { - Pf = v_level[l]->apply_prolongation_inj(v_level[l + 1]->fVec_initial); - } - } - else { - Pf = std::vector(v_level[l]->m, 0); - for (size_t i = 0; i < v_level[l]->ri_prol_inj.size(); i++) { - Pf[v_level[l]->ri_prol_inj[i]] += - v_level[l]->v_prol_inj[i] * v_level[l + 1]->fVec_initial[v_level[l]->ci_prol_inj[i]]; - } - } - - //apply P^T to u (restriction) - std::vector Pu; - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - Pu = v_level[l]->apply_prolongation_inj0(v_level[l]->u, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 1); - } - else { - Pu = v_level[l]->apply_restriction_inj(v_level[l]->u); - } - } - else { - Pu = std::vector(v_level[l]->mc, 0); - for (size_t i = 0; i < v_level[l]->ri_prol_inj.size(); i++) { - Pu[v_level[l]->ci_prol_inj[i]] += v_level[l]->v_prol_inj[i] * v_level[l]->u[v_level[l]->ri_prol_inj[i]]; - } - } - - //apply A(l+1) to Pu - std::vector APu(v_level[l + 1]->m, 0); - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - v_level[l + 1]->apply_A0(Pu, APu); //APu = A(l+1) * Pu - } - else { - double start = omp_get_wtime(); - v_level[l + 1]->apply_A(Pu, APu); //APu = A(l+1) * Pu - double end = omp_get_wtime(); - t_applyA += (end - start); - } - } - else { - if (gyro::icntl[Param::openmp] == 1) { - for (size_t i = 0; i < v_level[l + 1]->row_indices.size(); i++) { - APu[v_level[l + 1]->row_indices[i]] += v_level[l + 1]->vals[i] * Pu[v_level[l + 1]->col_indices[i]]; - } - } - else { - int j; -#pragma omp parallel for private(j) shared(APu) - for (j = 0; j < v_level[l + 1]->nr; j++) { - std::vector ptr_vect = v_level[l + 1]->get_ptr(j); - int ptr_start = ptr_vect[1]; - int ptr_end = ptr_start + (ptr_vect[2] - ptr_vect[1]) * v_level[l + 1]->ntheta_int; - for (int k = ptr_start; k < ptr_end; k++) { - APu[v_level[l + 1]->row_indices[k]] += - v_level[l + 1]->vals[k] * Pu[v_level[l + 1]->col_indices[k]]; - } - } - } - } - - //apply P to APu (prolongation) - std::vector PAPu; - if (gyro::icntl[Param::matrix_free] == 1) { - if (gyro::icntl[Param::optimized] == 0) { - PAPu = v_level[l]->apply_prolongation_inj0(APu, v_level[l]->mc, v_level[l]->m, - v_level[l]->coarse_nodes_list_r, - v_level[l]->coarse_nodes_list_theta, 0); - } - else { - PAPu = v_level[l]->apply_prolongation_inj(APu); - } - } - else { - PAPu = std::vector(v_level[l]->m, 0); - for (size_t i = 0; i < v_level[l]->ri_prol_inj.size(); i++) { - PAPu[v_level[l]->ri_prol_inj[i]] += v_level[l]->v_prol_inj[i] * APu[v_level[l]->ci_prol_inj[i]]; - } - } - - //res_ex = 4/3 * f(l) - 1/3 * f_1 - 4/3 * Au - 1/3 *PAPu - for (int i = 0; i < v_level[l]->m; ++i) { - v_level[l]->res[i] = - (4. / 3. * v_level[l]->fVec[i] - 1. / 3. * Pf[i]) - (4. / 3. * Au[i] - 1. / 3. * PAPu[i]); - } - } - //no extrapolation - else { - //compute res = f - A * u - for (unsigned long int i = 0; i < v_level[l]->res.size(); ++i) { - v_level[l]->res[i] -= Au[i]; //res(l) = res(l) - Au = f(l) - A*u - } - } -} /* ----- end of gmgpolar::compute_residual ----- */ - -/*! - * \brief Computes the error - * - * Computes the error compared to the theoretical solution and sclaed by its norm - * - * \return the error vector - * - */ -std::vector gmgpolar::compute_error() -{ - //compute the error vector (on level 0) between the computed and the analytical solution - std::vector error; - - int ntheta_int = v_level[0]->ntheta; - if (fabs(v_level[0]->theta[v_level[0]->ntheta - 1] - 2 * PI) < 1e-10) { - ntheta_int--; - } - - if (gyro::f_sol_in.empty()) { - for (int j = 0; j < v_level[0]->nr; ++j) { //iterate over the grid in polar coordinates - for (int i = 0; i < ntheta_int; ++i) { - int index = j * ntheta_int + i; //corresponding index of the solution vector - //double x; - //double y; - double theoretical_solution = - gyro::def_solution_rt(v_level[0]->r[j], v_level[0]->theta[i], 0); //compute the theoretical solution - double computed_solution = v_level[0]->u[index]; - error.push_back(fabs(theoretical_solution - computed_solution)); - } - } - } - else { - for (int j = 0; j < v_level[0]->nr; ++j) { //iterate over the grid in polar coordinates - for (int i = 0; i < ntheta_int; ++i) { - int index = j * ntheta_int + i; //corresponding index of the solution vector - double theoretical_solution = v_level[0]->sol_in[index]; - double computed_solution = v_level[0]->u[index]; - error.push_back(fabs(theoretical_solution - computed_solution)); - } - } - } - - return error; -} /* ----- end of gmgpolar::compute_error ----- */ - -/*! - * \brief Compute the backward error on level 0 - * - * Compute the backward error on level 0: - * ||b-Au||_inf / (||A||_inf ||x||_1 + ||b||_inf) - * - * \return the backward error - * - */ -double gmgpolar::compute_backwarderror() -{ - gmgpolar::compute_residual(0, 0); //compute residual on level 0, without extrapolation, save in v_level[0]->res - - double nrm_inf_res = 0; //inf norm of res=A*u -fVec - for (std::size_t i = 0; i < v_level[0]->res.size(); ++i) { //iterate over the grid in polar coordinates - if (fabs(v_level[0]->res[i]) > nrm_inf_res) { - nrm_inf_res = fabs(v_level[0]->res[i]); - } - } - - double nrm_inf_rhs = 0; //inf norm of the rhs-vector - for (std::size_t i = 0; i < v_level[0]->fVec.size(); ++i) { //iterate over the grid in polar coordinates - if (fabs(v_level[0]->fVec[i]) > nrm_inf_rhs) { - nrm_inf_rhs = fabs(v_level[0]->fVec[i]); - } - } - - double nrm_1_u = 0; //1-norm of the solution vector - for (std::size_t i = 0; i < v_level[0]->u.size(); ++i) { //iterate over the grid in polar coordinates - nrm_inf_rhs += fabs(v_level[0]->u[i]); - } - - double nrm_inf_A = 0; //inf norm of the operator A - double row_sum = 0; - int row_index = 0; - for (std::size_t i = 0; i < v_level[0]->vals.size(); ++i) { //iterate over all elements in A - if (v_level[0]->row_indices[i] == row_index) { //we are still in the same row of the matrix - row_sum += fabs(v_level[0]->vals[i]); - } - else { //we just started a new row of the matrix - if (nrm_inf_A < row_sum) { - nrm_inf_A = row_sum; - } - row_sum = 0; //set row_sum to zero again - row_index = v_level[0]->row_indices[i]; //save the last row_index to compare - } - } - - double backward_error = nrm_inf_res / (nrm_inf_A * nrm_1_u + nrm_inf_rhs); - - return backward_error; -} /* ----- end of gmgpolar::compute_backwarderror ----- */ diff --git a/src/polar_multigrid.cpp b/src/polar_multigrid.cpp deleted file mode 100644 index 3f701c43..00000000 --- a/src/polar_multigrid.cpp +++ /dev/null @@ -1,649 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/*! - * \file polar_multigrid.cpp - * \brief Implementation of the whole gmgpolar (grid + multigrid) - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "gmgpolar.h" -#include -#include -#include -#include - -template -void getrands(std::vector& x, Generator& gen, unsigned num) -{ - generate_n(std::back_inserter(x), num, ref(gen)); -} - -/*! - * \brief Solves the problem gyro with multigrid on levels - * - * Solves the problem gyro with multigrid on levels - * - */ -void gmgpolar::polar_multigrid() -{ - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Define the coarse grid nodes...\n"; - check_geom(); - define_coarse_nodes(); - - if (gyro::icntl[Param::verbose] > 2) { - std::cout << "\n"; - if (gyro::icntl[Param::prob] == 1) - std::cout << "Solving the Poisson equation "; - else if (gyro::icntl[Param::prob] == 5) - std::cout << "Solving the Cartesian problem (from Zoni2019) "; - else if (gyro::icntl[Param::prob] == 6) - std::cout << "Solving the Poloidal problem "; - if (gyro::icntl[Param::alpha_coeff] == 0) - std::cout << "with coefficient alpha in atan (Sonnendrucker) "; - else if (gyro::icntl[Param::alpha_coeff] == 1) - std::cout << "with coefficient alpha in exp(tanh) and steep variation at 0.5 "; - else if (gyro::icntl[Param::alpha_coeff] == 2) - std::cout << "with coefficient alpha in exp(tanh) (Zoni2019) and variation at 0.7 "; - if (gyro::icntl[Param::beta_coeff] == 0) - std::cout << "and coefficient beta=0\n"; - else if (gyro::icntl[Param::beta_coeff] == 1) - std::cout << "and coefficient beta=1/alpha\n"; - if (!gyro::icntl[Param::mod_pk]) - std::cout << "Considering POLAR coordinates with "; - else if (gyro::icntl[Param::mod_pk] == 1) - std::cout << "Considering the Shafranov geometry with kappa=" << gyro::dcntl[Param::kappa_eps] - << ", delta=" << gyro::dcntl[Param::delta_e] << ", and "; - else if (gyro::icntl[Param::mod_pk] == 2) - std::cout << "Considering the Czarny geometry with kappa=" << gyro::dcntl[Param::kappa_eps] - << ", delta=" << gyro::dcntl[Param::delta_e] << ", and "; - std::cout << gyro::dcntl[Param::R0] << " <= r <= " << gyro::dcntl[Param::R] << "\n"; - std::cout << "Using 9 point star FINITE DIFFERENCES.\n"; - std::cout << "Using FULL EXTRAPOLATION\n\n"; - } - - gyro::dcntl[Param::r0_DB] = -1e6; - if (gyro::icntl[Param::DirBC_Interior]) - gyro::dcntl[Param::r0_DB] = gyro::dcntl[Param::R0]; - - int testA = 0; - if (testA) { - int testPerf = 0; - int display_vectors = 0; - int nb_tests = 10; - int l = 0; - v_level[l]->m = v_level[l]->nr * v_level[l]->ntheta; - v_level[l]->define_nz(); - int m = v_level[l]->m; - std::cout << "\n***** Problem size " << m << " (" << v_level[0]->nr << ", " << v_level[0]->ntheta << ")\n"; - - double t, t_applyA = 0, t_applyA0 = 0; - - for (int i = 0; i < nb_tests; i++) { - std::cout << "Test " << i << "\n"; - std::vector ei, uC(m, 0); - - std::uniform_real_distribution unif(0.0, 1.0); - std::mt19937 re(std::random_device{}()); - auto generator = std::bind(unif, std::ref(re)); - getrands(ei, generator, m); - if (display_vectors) - gyro::disp(ei, "ei"); - - // Apply A0 - if (!testPerf) { - TIC; - uC = std::vector(m, 0); - v_level[l]->apply_A0(ei, uC); - t_applyA0 += TOC; - if (display_vectors) - gyro::disp(uC, "uC (A0)"); - } - // Apply A - TIC; - uC = std::vector(m, 0); - v_level[l]->apply_A(ei, uC); - t_applyA += TOC; - if (display_vectors) - gyro::disp(uC, "uC (A)"); - } - if (!testPerf) - std::cout << "t_applyA0: " << t_applyA0 << std::endl; - std::cout << "t_applyA: " << t_applyA << std::endl; - } - else { - if (gyro::icntl[Param::verbose] > 3){ - std::cout - << "Building discretized system, restriction and interpolation operators, and defining splittings...\n"; - } -#ifdef GMGPOLAR_USE_LIKWID -#pragma omp parallel -{ - LIKWID_MARKER_START("Setup"); -} -#endif - prepare_op_levels(); -#ifdef GMGPOLAR_USE_LIKWID -#pragma omp parallel -{ - LIKWID_MARKER_STOP("Setup"); -} -#endif - - int m = v_level[0]->m; - - std::string cycle_str = "?"; - if (gyro::icntl[Param::cycle] == 1) - cycle_str = "V"; - else if (gyro::icntl[Param::cycle] == 2) - cycle_str = "W"; - if (gyro::icntl[Param::verbose] > 2) { - std::cout << "\nProb: " << gyro::icntl[Param::prob] << ", alpha_coeff: " << gyro::icntl[Param::alpha_coeff] - << ", beta_coeff: " << gyro::icntl[Param::beta_coeff] << " ***** Problem size " << m << " (" - << v_level[0]->nr << ", " << v_level[0]->ntheta << "), " << levels - << " grids, nr_exp=" << gyro::icntl[Param::nr_exp] << ", aniso=" << gyro::icntl[Param::fac_ani] - << " ***** smoother=" << gyro::icntl[Param::smoother] << ", r0=" << gyro::dcntl[Param::R0] - << ", extrapolation=" << gyro::icntl[Param::extrapolation] - << ", mod_pk=" << gyro::icntl[Param::mod_pk] << ", DirBC=" << gyro::icntl[Param::DirBC_Interior] - << ", divide=" << gyro::icntl[Param::divideBy2] << " *****\n"; - } - - double scaling = 1.0; - if (gyro::icntl[Param::compute_rho]) - scaling = scaling / (sqrt(m)); - - v_level[0]->u.assign(m, scaling); //create an empty vector u - - if (gyro::icntl[Param::debug] > 0) { - debug(); - } - else if (gyro::icntl[Param::write_radii_angles] == 0) { - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Executing multigrid iteration....\n\n"; - multigrid_iter(); - - if (gyro::icntl[Param::verbose] > 1) { - for (int l = 0; l < levels; l++) { - std::cout << "LEVEL " << l << "\n"; - std::cout << "\tSmoothing: " << v_level[l]->t_smoothing << ", t_f_sc: " << v_level[l]->t_f_sc - << ", t_Asc_ortho: " << v_level[l]->t_Asc_ortho << ", t_Asc: " << v_level[l]->t_Asc - << "\n"; - std::cout << "\tt_get_ptr: " << v_level[l]->t_get_ptr - << ", t_get_stencil: " << v_level[l]->t_get_stencil - << ", t_get_smoother: " << v_level[l]->t_get_smoother - << ", t_get_row: " << v_level[l]->t_get_row; - std::cout << "\n"; - } - } - - if (gyro::icntl[Param::verbose] > 1) { - std::cout << "\nTotal setup: " << t_setup << "\n\tBuilding system matrix A and RHS: " << t_build - << "\n\tFactorization of coarse operator Ac: " << t_facto_Ac << "\n\tBuilding intergrid operators (e.g. projections): " << t_build_P - << "\n\tBuilding smoothing operators A_sc: " << t_build_Asc << "\n\tFactorizing smoothing operators A_sc: " << t_facto_Asc << "\n"; - std::cout << "Total multigrid cycle: " << t_total_mgcycle << "\n\tComplete smoothing: " << t_smoothing - << "\n\tComputing residual: " << t_residual << "\n\tApplying restriction: " << t_restriction - << "\n\tSolve coarse system: " << t_Ac << "\n\tApplying prolongation (+ coarse grid correction): " << t_prolongation - << "\nComputing residual on finest level: " << t_fine_residual; - if (gyro::icntl[Param::check_error] == 1) { - std::cout << "\nComputing final error: " << t_error; - } - std::cout << "\nTotal application of A: " << t_applyA; - std::cout << "\n"; - } - - if (gyro::icntl[Param::verbose] > 1) { - std::cout << "\nEvaluation of arr, art, and att: " << gyro::dcntl[Param::t_arr_art_att] - << "\n\tEvaluation of alpha and beta: " << gyro::dcntl[Param::t_coeff] - << "\n\tComputing determinant of Jacobian of inverse mapping: " << gyro::dcntl[Param::t_detDFinv]; - if (gyro::icntl[Param::check_error] == 1) { - std::cout << "\nComputing exact solution: " << gyro::dcntl[Param::t_sol]; - } - - std::cout << "\n"; - } - } - } -} /* ----- end of gmgpolar::polar_multigrid ----- */ - -/*! - * \brief Check the geometry construction - * - * Check the geometry construction - * - */ -void gmgpolar::check_geom() -{ - // intervals(!) not nodes in r direction (corresponds to nodes-1, - // i.e., without considering the origin which is here always defined - // as a node of the finest mesh only) - int ntheta = v_level[0]->ntheta - 1; - int nr = v_level[0]->nr - 1; - - if (gyro::icntl[Param::level] == -1 || gyro::icntl[Param::level] < 2) { - // at least two levels/grids.. and if more than two grids, at least 3 nodes - // per circle and per row on coarsest mesh!! - levels = std::max(2, (int)floor(std::min(log2(nr + 1) - 1, log2(ntheta + 2) - 1))); - } - else { - levels = gyro::icntl[Param::level]; - } - std::cout << "Desired number of levels: " << levels << "\n"; - - double Rmax = v_level[0]->r[nr]; - double R0 = v_level[0]->r[0]; - gyro::dcntl[Param::r0_DB] = -1; - if (R0 > 0) - gyro::dcntl[Param::r0_DB] = R0; - if (gyro::icntl[Param::verbose] > 2) - std::cout << "levels: " << levels << ", Rmax: " << Rmax << "\n"; - if (Rmax != gyro::dcntl[Param::R]) - throw std::runtime_error("Program stopped... r[end] != R..."); - if (R0 != gyro::dcntl[Param::R0]) - throw std::runtime_error("Program stopped... r[0] != R0..."); - if (gyro::dcntl[Param::extrapolation] > 0 && levels < 3) - throw std::runtime_error("ATTENTION: extrapolation technique needs at least three levels..."); -} /* ----- end of gmgpolar::polar_multigrid ----- */ - -/*! - * \brief Prepare the levels for operator construction - * - * Prepare the levels for operator construction - * - */ -void gmgpolar::prepare_op_levels() -{ - double t; - TIC; - t_setup = t; - - for (int l = levels - 1; l >= 0; l--) { //define m on the coarsest level - v_level[l]->m = v_level[l]->nr * v_level[l]->ntheta; - v_level[l]->define_nz(); - - v_level[l]->betaVec = std::vector(v_level[l]->m, 0); - v_level[l]->build_betaVec(); - - if (l < levels - 1) - v_level[l]->mc = v_level[l + 1]->m; - - if (l == 0 && !gyro::f_sol_in.empty()) { - v_level[0]->read_sol(); - } - - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Create operator on level " << l << "\n"; - if (l == levels - 1 || gyro::icntl[Param::matrix_free] == 0) { - TIC; - if (gyro::icntl[Param::optimized] == 0 || v_level[l]->nr_int < 2 + gyro::icntl[Param::DirBC_Interior]) { - std::cout << "Using the original construction of A and the RHS since nr_int is very " - "small.\n\n\n\n"; - v_level[l]->build_A0(); - v_level[l]->build_rhs0(); - } - else { - v_level[l]->row_indices = std::vector(v_level[l]->nz); - v_level[l]->col_indices = std::vector(v_level[l]->nz); - v_level[l]->vals = std::vector(v_level[l]->nz, 0); - v_level[l]->fVec = std::vector(v_level[l]->m); - v_level[l]->build_A(); - if (l == 0 || (l == 1 && gyro::icntl[Param::extrapolation] > 0)) { - v_level[l]->build_rhs(); - } - } - t_build += TOC; - TIC; - - if (l == levels - 1) { - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Factorizing coarse operator...\n"; - TIC; -#ifdef GMGPOLAR_USE_MUMPS - std::cout << "\n Using GMGPolar with MUMPS\n"; - if (gyro::icntl[Param::optimized] == 0) { -#else - std::cout << "\n Attention: Using GMGPolar without MUMPS (Coarse solve is very slow)\n"; -#endif - v_level[l]->row_Ac_LU = std::vector(v_level[l]->row_indices); - v_level[l]->col_Ac_LU = std::vector(v_level[l]->col_indices); - v_level[l]->vals_Ac_LU = std::vector(v_level[l]->vals); - v_level[l]->row_indices.clear(); - v_level[l]->col_indices.clear(); - v_level[l]->vals.clear(); - v_level[l]->row_indices.shrink_to_fit(); - v_level[l]->col_indices.shrink_to_fit(); - v_level[l]->vals.shrink_to_fit(); - v_level[l]->facto_gaussian_elimination(v_level[l]->row_Ac_LU, v_level[l]->col_Ac_LU, - v_level[l]->vals_Ac_LU, v_level[l]->m); -#ifdef GMGPOLAR_USE_MUMPS - } - else - v_level[l]->facto_mumps(v_level[l]->mumps_Ac, v_level[l]->row_indices, v_level[l]->col_indices, - v_level[l]->vals, v_level[l]->m); -#endif - t_facto_Ac += TOC; - } - TIC; - } - else { - TIC; - if (gyro::icntl[Param::optimized] == 0) - v_level[l]->build_rhs0(); - else { - v_level[l]->fVec = std::vector(v_level[l]->m); - if (l == 0 || (l == 1 && gyro::icntl[Param::extrapolation] > 0)) { - v_level[l]->build_rhs(); - } - } - t_build += TOC; - TIC; - } - - // Prolongation defined on all except the coarsest level - if (l < levels - 1) { - v_level[l]->define_line_splitting(); - if (gyro::icntl[Param::verbose] > 3) - std::cout << "delete_circles: " << v_level[l]->delete_circles << "\n"; - - // Number of blocks per smoother - v_level[l]->nblocks = std::vector(5); - v_level[l]->nblocks[0] = ceil(v_level[l]->delete_circles * 0.5); - v_level[l]->nblocks[1] = floor(v_level[l]->delete_circles * 0.5); - v_level[l]->nblocks[2] = v_level[l]->ntheta_int * 0.5; - v_level[l]->nblocks[3] = v_level[l]->nblocks[2]; - v_level[l]->nblocks[4] = std::max(v_level[l]->nblocks[0], v_level[l]->nblocks[2]); - - for (int smoother = 0; smoother < 4; smoother++) { - int size = 0, size_ortho = 0, *array_temp, *array_temp2; - if (smoother < 2) { - size_ortho = v_level[l]->delete_circles + 1; - size = v_level[l]->delete_circles; - } - else if (smoother > 1) { - size_ortho = v_level[l]->ntheta_int; - size = v_level[l]->ntheta_int; - } - array_temp = new int[size_ortho]; - for (int i = 0; i < size_ortho; i++) - array_temp[i] = 0; - array_temp2 = new int[size]; - for (int i = 0; i < size; i++) - array_temp2[i] = 0; - v_level[l]->dep_Asc_ortho.push_back(array_temp); - v_level[l]->dep_Asc.push_back(array_temp2); - v_level[l]->size_Asc_ortho.push_back(size_ortho); - v_level[l]->size_Asc.push_back(size); - } - - // Smoother matrices Asc - TIC; - //build matrices A_sc - if (gyro::icntl[Param::verbose] > 3) - std::cout << "build Asc on level " << l << ", m: " << v_level[l]->m << ", mc: " << v_level[l]->mc - << "\n"; - v_level[l]->define_m_nz_Asc(); - if (gyro::icntl[Param::optimized] == 0) { - v_level[l]->build_Asc0(); - } - else { - // 1 block matrix per row (column) for the circle (radial) smoother - for (int smoother = 0; smoother < 4; smoother++) { - v_level[l]->A_Zebra_r_row[smoother].assign(v_level[l]->nblocks[smoother], std::vector()); - v_level[l]->A_Zebra_c_row[smoother].assign(v_level[l]->nblocks[smoother], std::vector()); - v_level[l]->A_Zebra_v_row[smoother].assign(v_level[l]->nblocks[smoother], std::vector()); - for (int ij = 0; ij < v_level[l]->nblocks[smoother]; ij++) { - int nsc = v_level[l]->define_nz_Asc_ij(smoother, ij, 0); - v_level[l]->A_Zebra_r_row[smoother][ij] = std::vector(nsc); - v_level[l]->A_Zebra_c_row[smoother][ij] = std::vector(nsc); - v_level[l]->A_Zebra_v_row[smoother][ij] = std::vector(nsc, 0); - } - } - // define Asc blocks - v_level[l]->build_Asc(); - - if (gyro::icntl[Param::matrix_free] == 0) { - // 1 block matrix per row (column) for the circle (radial) smoother - v_level[l]->A_Zebra_Mix_r.assign(4, std::vector()); - v_level[l]->A_Zebra_Mix_c.assign(4, std::vector()); - v_level[l]->A_Zebra_Mix_v.assign(4, std::vector()); - for (int smoother = 0; smoother < 4; smoother++) { - int nsc = v_level[l]->nz_sc_ortho[smoother]; - v_level[l]->A_Zebra_Mix_r[smoother] = std::vector(nsc); - v_level[l]->A_Zebra_Mix_c[smoother] = std::vector(nsc); - v_level[l]->A_Zebra_Mix_v[smoother] = std::vector(nsc, 0); - - // define Asc_ortho block - v_level[l]->build_Asc_ortho(smoother); - - // Build vectors necessary for the parallel application of Asc_ortho: - // - ptr contains the nz entry for the points in the first radial line - // - shift contains the number of entries per node - int size_radial_line = v_level[l]->nr_int - v_level[l]->delete_circles; - v_level[l]->shift_vect_s2 = - std::vector(size_radial_line); // shift between 2 radial lines for smoother 2 - v_level[l]->shift_vect_s3 = std::vector(size_radial_line); // idem for smoother 3 - v_level[l]->ptr_vect_s2 = std::vector(size_radial_line); // ptr to a radial line for smoother 2 - v_level[l]->ptr_vect_s3 = std::vector(size_radial_line); // idem for smoother 3 - std::vector ptr_vect; - for (int j = v_level[l]->delete_circles; j < v_level[l]->nr_int; j++) { - ptr_vect = v_level[l]->get_ptr_sc(j, 2, 1); - v_level[l]->ptr_vect_s2[j - v_level[l]->delete_circles] = ptr_vect[0]; - v_level[l]->ptr_vect_s3[j - v_level[l]->delete_circles] = ptr_vect[1]; - v_level[l]->shift_vect_s2[j - v_level[l]->delete_circles] = ptr_vect[2] - ptr_vect[0]; - v_level[l]->shift_vect_s3[j - v_level[l]->delete_circles] = ptr_vect[3] - ptr_vect[1]; - } - } - } - } - - t_build_Asc += TOC; - TIC; - - if (gyro::icntl[Param::optimized] == 0) { -#ifdef GMGPOLAR_USE_MUMPS - if (gyro::icntl[Param::optimized] == 0) { -#endif - v_level[l]->A_Zebra_r_LU.assign(4, std::vector()); - v_level[l]->A_Zebra_c_LU.assign(4, std::vector()); - v_level[l]->A_Zebra_v_LU.assign(4, std::vector()); - for (int smoother = 0; smoother < 4; smoother++) { - v_level[l]->A_Zebra_r_LU[smoother] = std::vector(v_level[l]->A_Zebra_r[smoother]); - v_level[l]->A_Zebra_c_LU[smoother] = std::vector(v_level[l]->A_Zebra_c[smoother]); - v_level[l]->A_Zebra_v_LU[smoother] = std::vector(v_level[l]->A_Zebra_v[smoother]); - v_level[l]->A_Zebra_r[smoother].clear(); - v_level[l]->A_Zebra_c[smoother].clear(); - v_level[l]->A_Zebra_v[smoother].clear(); - v_level[l]->A_Zebra_r[smoother].shrink_to_fit(); - v_level[l]->A_Zebra_c[smoother].shrink_to_fit(); - v_level[l]->A_Zebra_v[smoother].shrink_to_fit(); - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Factorizing smoother " << smoother << "...\n"; - v_level[l]->facto_gaussian_elimination( - v_level[l]->A_Zebra_r_LU[smoother], v_level[l]->A_Zebra_c_LU[smoother], - v_level[l]->A_Zebra_v_LU[smoother], v_level[l]->m_sc[smoother]); - } - v_level[l]->A_Zebra_r.clear(); - v_level[l]->A_Zebra_c.clear(); - v_level[l]->A_Zebra_v.clear(); - v_level[l]->A_Zebra_r.shrink_to_fit(); - v_level[l]->A_Zebra_c.shrink_to_fit(); - v_level[l]->A_Zebra_v.shrink_to_fit(); -#ifdef GMGPOLAR_USE_MUMPS - } - else - for (int smoother = 0; smoother < 4; smoother++) - v_level[l]->facto_mumps(v_level[l]->mumps_A_Zebra[smoother], v_level[l]->A_Zebra_r[smoother], - v_level[l]->A_Zebra_c[smoother], v_level[l]->A_Zebra_v[smoother], - v_level[l]->m_sc[smoother]); -#endif - t_facto_Asc += TOC; - TIC; - } - else { - for (int smoother = 0; smoother < 4; smoother++) { - TIC; - v_level[l]->A_Zebra_r_LU_row[smoother].assign(v_level[l]->nblocks[smoother], std::vector()); - v_level[l]->A_Zebra_c_LU_row[smoother].assign(v_level[l]->nblocks[smoother], std::vector()); - v_level[l]->A_Zebra_v_LU_row[smoother].assign(v_level[l]->nblocks[smoother], std::vector()); - t_facto_Asc += TOC; - TIC; - for (int ij = 0; ij < v_level[l]->nblocks[smoother]; ij++) { - // Diagonal smoother if: - // - DB and first radius - // - only 1 element (should not happen) - // - extrapolation on level 0 for smoothers 0 and 2 (except across the origin stencil) - if ((smoother == 0 && ij == 0 && gyro::icntl[Param::DirBC_Interior]) || - v_level[l]->m_sc[smoother] == 1 || - (gyro::icntl[Param::extrapolation] && l == 0 && smoother % 2 == 0 && - !(smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && ij == 0))) { - if (gyro::icntl[Param::verbose] > 3) - std::cout << "No diagonal factorization\n"; - v_level[l]->A_Zebra_v_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_v_row[smoother][ij]); - } - // Circle smoother if: - // - smoother 0 or 1 - // - and not across - else if (smoother < 2 && !(smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && ij == 0)) { - TIC; - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Circle factorization\n"; - // Initialize the LU factors - v_level[l]->fill_in_circle(ij, smoother); - // Factorization - v_level[l]->facto_circle( - v_level[l]->A_Zebra_r_LU_row[smoother][ij], v_level[l]->A_Zebra_c_LU_row[smoother][ij], - v_level[l]->A_Zebra_v_LU_row[smoother][ij], v_level[l]->m_sc[smoother]); -#pragma omp atomic - t_facto_Asc += TOC; - TIC; - } - else if (smoother > 1) { - TIC; - // Initialize the LU factors - v_level[l]->A_Zebra_r_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_r_row[smoother][ij]); - v_level[l]->A_Zebra_c_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_c_row[smoother][ij]); - v_level[l]->A_Zebra_v_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_v_row[smoother][ij]); - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Radial factorization\n"; - // Factorization - v_level[l]->facto_radial( - v_level[l]->A_Zebra_r_LU_row[smoother][ij], v_level[l]->A_Zebra_c_LU_row[smoother][ij], - v_level[l]->A_Zebra_v_LU_row[smoother][ij], v_level[l]->m_sc[smoother]); -#pragma omp atomic - t_facto_Asc += TOC; - TIC; - } - if (smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && ij == 0) { - TIC; - v_level[l]->A_Zebra_r_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_r_row[smoother][ij]); - v_level[l]->A_Zebra_c_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_c_row[smoother][ij]); - v_level[l]->A_Zebra_v_LU_row[smoother][ij] = - std::vector(v_level[l]->A_Zebra_v_row[smoother][ij]); - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Across factorization..."; -#ifdef GMGPOLAR_USE_MUMPS - if (gyro::icntl[Param::optimized] == 0) { -#endif - if (gyro::icntl[Param::verbose] > 3) - std::cout << "using in-house direct solver.\n"; - // Factorization - v_level[l]->facto_gaussian_elimination(v_level[l]->A_Zebra_r_LU_row[smoother][ij], - v_level[l]->A_Zebra_c_LU_row[smoother][ij], - v_level[l]->A_Zebra_v_LU_row[smoother][ij], - v_level[l]->m_sc[smoother]); -#ifdef GMGPOLAR_USE_MUMPS - } - else { - if (gyro::icntl[Param::verbose] > 2) - std::cout << "using MUMPS.\n"; - v_level[l]->facto_mumps( - v_level[l]->mumps_across, v_level[l]->A_Zebra_r_row[smoother][ij], - v_level[l]->A_Zebra_c_row[smoother][ij], v_level[l]->A_Zebra_v_row[smoother][ij], - v_level[l]->m_sc[smoother]); - } -#endif -#pragma omp atomic - t_facto_Asc += TOC; - TIC; - } - v_level[l]->A_Zebra_r_row[smoother][ij].clear(); - v_level[l]->A_Zebra_c_row[smoother][ij].clear(); - v_level[l]->A_Zebra_v_row[smoother][ij].clear(); - v_level[l]->A_Zebra_r_row[smoother][ij].shrink_to_fit(); - v_level[l]->A_Zebra_c_row[smoother][ij].shrink_to_fit(); - v_level[l]->A_Zebra_v_row[smoother][ij].shrink_to_fit(); - } - v_level[l]->A_Zebra_r_row[smoother].clear(); - v_level[l]->A_Zebra_c_row[smoother].clear(); - v_level[l]->A_Zebra_v_row[smoother].clear(); - v_level[l]->A_Zebra_r_row[smoother].shrink_to_fit(); - v_level[l]->A_Zebra_c_row[smoother].shrink_to_fit(); - v_level[l]->A_Zebra_v_row[smoother].shrink_to_fit(); - } - } - - // Prolongation defined on all except the coarsest level - TIC; - if (gyro::icntl[Param::matrix_free] == 0) { - v_level[l]->define_nz_P(); - - // // Number of nonzeros in the matrix - if (gyro::icntl[Param::verbose] > 3) - std::cout << "nz_P: " << v_level[l]->nz_P << "\n"; - v_level[l]->ri_prol = std::vector(v_level[l]->nz_P); - v_level[l]->ci_prol = std::vector(v_level[l]->nz_P); - v_level[l]->v_prol = std::vector(v_level[l]->nz_P); - v_level[l]->build_prolongation_bi(); - - // // Number of nonzeros in the matrix - if (gyro::icntl[Param::verbose] > 3) - std::cout << "nz_P_inj: " << v_level[l]->nz_P_inj << "\n"; - v_level[l]->ri_prol_inj = std::vector(v_level[l]->nz_P_inj); - v_level[l]->ci_prol_inj = std::vector(v_level[l]->nz_P_inj); - v_level[l]->v_prol_inj = std::vector(v_level[l]->nz_P_inj); - v_level[l]->build_prolongation_inj(); - - // // Number of nonzeros in the matrix - if (gyro::icntl[Param::verbose] > 3) - std::cout << "nz_P_ex: " << v_level[l]->nz_P_ex << "\n"; - v_level[l]->ri_prol_ex = std::vector(v_level[l]->nz_P_ex); - v_level[l]->ci_prol_ex = std::vector(v_level[l]->nz_P_ex); - v_level[l]->v_prol_ex = std::vector(v_level[l]->nz_P_ex); - v_level[l]->build_prolongation_ex(); - - t_build_P += TOC; - TIC; - } - } - } - - if (gyro::icntl[Param::verbose] > 3) - std::cout << "Operators created.\n"; - - t = t_setup; - t_setup = TOC; -} /* ----- end of level::prepare_op_levels ----- */ \ No newline at end of file diff --git a/src/prolongation.cpp b/src/prolongation.cpp deleted file mode 100644 index 548efeed..00000000 --- a/src/prolongation.cpp +++ /dev/null @@ -1,1141 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file prolongation.cpp - * \brief Implementation of the prolongation operators - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ -#include "level.h" - -/*! - * \brief Builds the bilinear interpolation - * - * Builds bilinear interpolation for Dirichlet boundary conditions in - * variable r and periodic boundary conditions in phi. Can be used for a - * disk as well as for an annulus. (might be used for other geometries with - * Dirichlet boundary conditions in 'x' and periodic boundary conditions - * in 'y' as well; not tested!) - * - * uses Anisotropic Bilinear Interpolation stencil - * for isotropic mesh, anisotropic stencil reduces to isotropic definition - * ]1 2 1[ - * 1/4 ]2 4 2[ - * ]1 2 1[ - * - */ -void level::build_prolongation_bi() -{ - int index = 0; - int row, col; - double h_prev, h_next, k_prev, k_next, denum, val; - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - - // Coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - col = j * ntheta_int / 4 + i / 2; - val = 1.0; - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - } - } - // Coarse nodes in same r (2i, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - k_prev = thetaplus[(i + ntheta_int - 1) % ntheta_int]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - - // Previous coarse node (left) - col = j * ntheta_int / 4 + (i - 1) / 2; - val = k_next * denum; // 1/2 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - - // Next coarse node (right) - col = j * ntheta_int / 4 + iplus_vect[i] / 2; - val = k_prev * denum; // 1/2 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - } - } - // Coarse nodes in same theta (2i+1, 2j) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; (TODO correct comment) - for (int j = 1; j <= nr_int - 1; j += 2) { - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / (h_prev + h_next); - - // Previous coarse node (bottom) - col = (j - 1) * ntheta_int / 4 + i / 2; - val = h_next * denum; // 1/2 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - - // Next coarse node (top) - col = (j + 1) * ntheta_int / 4 + i / 2; - val = h_prev * denum; // 1/2 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - } - } - // Coarse nodes in diagonals (2i+1, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; (TODO correct comment) - for (int j = 1; j <= nr_int - 1; j += 2) { - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - k_prev = thetaplus[i - 1]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - - // top_right - col = (j + 1) * ntheta_int / 4 + iplus_vect[i] / 2; - val = h_prev * k_prev * denum; // isotrop: 1/4 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - // top_left - col = (j + 1) * ntheta_int / 4 + (i - 1) / 2; - val = h_prev * k_next * denum; // isotrop: 1/4 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - - // bottom_right - col = (j - 1) * ntheta_int / 4 + iplus_vect[i] / 2; - val = h_next * k_prev * denum; // isotrop: 1/4 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - // bottom_left - col = (j - 1) * ntheta_int / 4 + (i - 1) / 2; - val = h_next * k_next * denum; // isotrop: 1/4 - ri_prol[index] = row; - ci_prol[index] = col; - v_prol[index] = val; - index++; - } - } -} /* ----- end of level::build_prolongation_bi ----- */ - -/*! - * \brief Applies the bilinear interpolation - * - * Applies bilinear interpolation for Dirichlet boundary conditions in - * variable r and periodic boundary conditions in phi. Can be used for a - * disk as well as for an annulus. (might be used for other geometries with - * Dirichlet boundary conditions in 'x' and periodic boundary conditions - * in 'y' as well; not tested!) - * - * uses Anisotropic Bilinear Interpolation stencil - * for isotropic mesh, anisotropic stencil reduces to isotropic definition - * ]1 2 1[ - * 1/4 ]2 4 2[ - * ]1 2 1[ - * - */ -std::vector level::apply_prolongation_bi(std::vector u) -{ - //Prolongation (P * u = Pu), (m x mc) * mc = m - std::vector Pu = std::vector(m, 0); - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - -#pragma omp parallel shared(iplus_vect) - { -#pragma omp single - { - // Coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - col = j * ntheta_int / 4 + i / 2; - val = 1.0; - Pu[row] += val * u[col]; - } - } //end of task - } - // Coarse nodes in same r (2i, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double k_prev, k_next, denum, val; - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - k_prev = thetaplus[(i + ntheta_int - 1) % ntheta_int]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - - // Previous coarse node (left) - col = j * ntheta_int / 4 + (i - 1) / 2; - val = k_next * denum; // 1/2 - Pu[row] += val * u[col]; - - // Next coarse node (right) - col = j * ntheta_int / 4 + iplus_vect[i] / 2; - val = k_prev * denum; // 1/2 - Pu[row] += val * u[col]; - } - } //end of task - } - // Coarse nodes in same theta (2i+1, 2j) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; (TODO: correct comment) - for (int j = 1; j <= nr_int - 1; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double h_prev, h_next, denum, val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / (h_prev + h_next); - - // Previous coarse node (bottom) - col = (j - 1) * ntheta_int / 4 + i / 2; - val = h_next * denum; // 1/2 - Pu[row] += val * u[col]; - - // Next coarse node (top) - col = (j + 1) * ntheta_int / 4 + i / 2; - val = h_prev * denum; // 1/2 - Pu[row] += val * u[col]; - } - } //end of task - } - // Coarse nodes in diagonals (2i+1, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; (TODO: correct comment) - for (int j = 1; j <= nr_int - 1; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double k_prev, k_next, h_prev, h_next, denum, val; - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - k_prev = thetaplus[i - 1]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - - // top_right - col = (j + 1) * ntheta_int / 4 + iplus_vect[i] / 2; - val = h_prev * k_prev * denum; // isotrop: 1/4 - Pu[row] += val * u[col]; - // top_left - col = (j + 1) * ntheta_int / 4 + (i - 1) / 2; - val = h_prev * k_next * denum; // isotrop: 1/4 - Pu[row] += val * u[col]; - - // bottom_right - col = (j - 1) * ntheta_int / 4 + iplus_vect[i] / 2; - val = h_next * k_prev * denum; // isotrop: 1/4 - Pu[row] += val * u[col]; - // bottom_left - col = (j - 1) * ntheta_int / 4 + (i - 1) / 2; - val = h_next * k_next * denum; // isotrop: 1/4 - Pu[row] += val * u[col]; - } - } //end of task - } - } //end of single - } //end of parallel - - return Pu; -} /* ----- end of level::apply_prolongation_bi ----- */ - -/*! - * \brief Applies the bilinear interpolation - * - * Applies bilinear interpolation for Dirichlet boundary conditions in - * variable r and periodic boundary conditions in phi. Can be used for a - * disk as well as for an annulus. (might be used for other geometries with - * Dirichlet boundary conditions in 'x' and periodic boundary conditions - * in 'y' as well; not tested!) - * - * uses Anisotropic Bilinear Interpolation stencil - * for isotropic mesh, anisotropic stencil reduces to isotropic definition - * ]1 2 1[ - * 1/4 ]2 4 2[ - * ]1 2 1[ - * - */ -std::vector level::apply_restriction_bi(std::vector u) -{ - //Restriction (P^T * u = Pu), (mc x m) * m = mc - std::vector Pu = std::vector(mc, 0); - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - std::vector imoins_vect(ntheta_int); - for (int i = 1; i < ntheta_int; i++) - imoins_vect[i] = i - 1; - imoins_vect[0] = ntheta_int - 1; - -#pragma omp parallel shared(iplus_vect) - { -#pragma omp single - { - // // Loop through all coarse nodes - // First and last radius - // => nb_nodes = ntheta_int; - int jc = 0; -#pragma omp task firstprivate(jc) shared(iplus_vect, imoins_vect, Pu) - { - int row, col, i, j, ic, i_f, j_f; - double k_prev, k_next, h_prev, h_next, denum, val; - for (ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - - // // Fine nodes in same r (2i, 2j+1) - // Next fine node (right) - i = iplus_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - val = k_next * denum; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (left) - i = imoins_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - val = k_prev * denum; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in same theta (2i+1, 2j) - // Next fine node (top) - i = i_f; - j = j_f + 1; - row = j * ntheta_int + i; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / (h_prev + h_next); - val = h_next * denum; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in diagonals (2i+1, 2j+1) - // top_left - i = imoins_vect[i_f]; - j = j_f + 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_next * k_prev * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - // top_right - i = iplus_vect[i_f]; - j = j_f + 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_next * k_next * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - } - } //end of task - jc = nr_int / 2; -#pragma omp task firstprivate(jc) shared(iplus_vect, imoins_vect, Pu) - { - int row, col, i, j, ic, i_f, j_f; - double k_prev, k_next, h_prev, h_next, denum, val; - for (ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - - // // Fine nodes in same r (2i, 2j+1) - // Next fine node (right) - i = iplus_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - val = k_next * denum; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (left) - i = imoins_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - val = k_prev * denum; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in same theta (2i+1, 2j) - // Previous fine node (bottom) - i = i_f; - j = j_f - 1; - row = j * ntheta_int + i; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / (h_prev + h_next); - val = h_prev * denum; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in diagonals (2i+1, 2j+1) - // bottom_left - i = imoins_vect[i_f]; - j = j_f - 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_prev * k_prev * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - // bottom_right - i = iplus_vect[i_f]; - j = j_f - 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_prev * k_next * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - } - } //end of task - // Interior - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; TODO: Correct comment - for (int jc = 1; jc < nr_int / 2; jc++) { -#pragma omp task firstprivate(jc) shared(iplus_vect, imoins_vect, Pu) - { - int row, col, i, j, ic, i_f, j_f; - double k_prev, k_next, h_prev, h_next, denum, val; - for (ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - - // // Fine nodes in same r (2i, 2j+1) - // Next fine node (right) - i = iplus_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - val = k_next * denum; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (left) - i = imoins_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - denum = 1 / (k_prev + k_next); - val = k_prev * denum; // 1/2 - Pu[col] += val * u[row]; - - // // Coarse nodes in same theta (2i+1, 2j) - // Next fine node (top) - i = i_f; - j = j_f + 1; - row = j * ntheta_int + i; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / (h_prev + h_next); - val = h_next * denum; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (bottom) - i = i_f; - j = j_f - 1; - row = j * ntheta_int + i; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / (h_prev + h_next); - val = h_prev * denum; // 1/2 - Pu[col] += val * u[row]; - - // // Coarse nodes in diagonals (2i+1, 2j+1) - // bottom_left - i = imoins_vect[i_f]; - j = j_f - 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_prev * k_prev * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - // bottom_right - i = iplus_vect[i_f]; - j = j_f - 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_prev * k_next * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - // top_left - i = imoins_vect[i_f]; - j = j_f + 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_next * k_prev * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - // top_right - i = iplus_vect[i_f]; - j = j_f + 1; - row = j * ntheta_int + i; - k_prev = thetaplus[imoins_vect[i]]; - k_next = thetaplus[i]; - h_prev = hplus[j - 1]; - h_next = hplus[j]; - denum = 1 / ((k_prev + k_next) * (h_prev + h_next)); - val = h_next * k_next * denum; // isotrop: 1/4 - Pu[col] += val * u[row]; - } - } //end of task - } - } //end of single - } //end of parallel - - return Pu; -} /* ----- end of level::apply_restriction_bi ----- */ - -/*! - * \brief Builds the injection - * - * Builds injection: directly inject values of coarse nodes. - * Just uses values 1.0 for nodes of type 0. - * - */ -void level::build_prolongation_inj() -{ - int index = 0; - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - - // Coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { - int row, col; - double val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - col = j * ntheta_int / 4 + i / 2; - val = 1.0; - ri_prol_inj[index] = row; - ci_prol_inj[index] = col; - v_prol_inj[index] = val; - index++; - } - } -} /* ----- end of level::build_prolongation_inj ----- */ - -/*! - * \brief Applies the injection - * - * Applies injection: directly inject values of coarse nodes. - * Just uses values 1.0 for nodes of type 0. - * - */ -std::vector level::apply_prolongation_inj(std::vector u) -{ - std::vector Pu; - //Prolongation (P * u = Pu), (m x mc) * mc = m - Pu = std::vector(m, 0); - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - -#pragma omp parallel shared(iplus_vect) - { -#pragma omp single - { - // Coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - col = j * ntheta_int / 4 + i / 2; - val = 1.0; - Pu[row] += val * u[col]; - } - } //end of task - } - } //end of single - } //end of parallel - - return Pu; -} /* ----- end of level::apply_prolongation_inj ----- */ - -/*! - * \brief Applies the injection - * - * Applies injection: directly inject values of coarse nodes. - * Just uses values 1.0 for nodes of type 0. - * - */ -std::vector level::apply_restriction_inj(std::vector u) -{ - //Restriction (P^T * u = Pu), (mc x m) * m = mc - std::vector Pu = std::vector(mc, 0); - -#pragma omp parallel - { -#pragma omp single - { - // Loop through all coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int jc = 0; jc < nr_int / 2 + 1; jc++) { -#pragma omp task firstprivate(jc) shared(Pu) - { - int row, col, i, j, i_f, j_f; - double val; - for (int ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - } - } //end of task - } - } //end of single - } //end of parallel - - return Pu; -} /* ----- end of level::apply_restriction_inj ----- */ - -/*! - * \brief Builds the extrapolation operator - * - * Builds the prolongation operator for implicit extrapolation. - * - * The stencil is the same as the isotropic bilinear interpolation stencil, - * except for fine points with diagonal coarse neighboors (types 5,6,7) where only - * top_left and top_right values are used. - * - */ -void level::build_prolongation_ex() -{ - int index = 0; - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - - // Coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { - int row, col; - double val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - col = j * ntheta_int / 4 + i / 2; - val = 1.0; - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - } - } - // Coarse nodes in same r (2i, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { - int row, col; - double val; - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - - // Previous coarse node (left) - col = j * ntheta_int / 4 + (i - 1) / 2; - val = 0.5; // 1/2 - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - - // Next coarse node (right) - col = j * ntheta_int / 4 + iplus_vect[i] / 2; - val = 0.5; // 1/2 - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - } - } - // Coarse nodes in same theta (2i+1, 2j) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; TODO: Correct comment - int row, col; - double val; - for (int j = 1; j <= nr_int - 1; j += 2) { - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - - // Previous coarse node (bottom) - col = (j - 1) * ntheta_int / 4 + i / 2; - val = 0.5; // 1/2 - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - - // Next coarse node (top) - col = (j + 1) * ntheta_int / 4 + i / 2; - val = 0.5; // 1/2 - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - } - } - // Coarse nodes in diagonals (2i+1, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; TODO: Correct comment - for (int j = 1; j <= nr_int - 1; j += 2) { - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - - // no top_right - // top_left - col = (j + 1) * ntheta_int / 4 + (i - 1) / 2; - val = 0.5; // 1/2 - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - // bottom_right - col = (j - 1) * ntheta_int / 4 + iplus_vect[i] / 2; - val = 0.5; // 1/2 - ri_prol_ex[index] = row; - ci_prol_ex[index] = col; - v_prol_ex[index] = val; - index++; - // no bottom_left - } - } -} /* ----- end of level::build_prolongation_ex ----- */ - -/*! - * \brief Applies the extrapolation operator - * - * Applies the prolongation operator for implicit extrapolation. - * - * The stencil is the same as the isotropic bilinear interpolation stencil, - * except for fine points with diagonal coarse neighboors (types 5,6,7) where only - * top_left and top_right values are used. - * - */ -std::vector level::apply_prolongation_ex(std::vector u) -{ - std::vector Pu; - //Prolongation (P * u = Pu), (m x mc) * mc = m - Pu = std::vector(m, 0); - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - -#pragma omp parallel shared(iplus_vect) - { -#pragma omp single - { - // Coarse nodes - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - col = j * ntheta_int / 4 + i / 2; - val = 1.0; - Pu[row] += val * u[col]; - } - } //end of task - } - // Coarse nodes in same r (2i, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; - for (int j = 0; j < nr; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double val; - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - - // Previous coarse node (left) - col = j * ntheta_int / 4 + (i - 1) / 2; - val = 0.5; // 1/2 - Pu[row] += val * u[col]; - - // Next coarse node (right) - col = j * ntheta_int / 4 + iplus_vect[i] / 2; - val = 0.5; // 1/2 - Pu[row] += val * u[col]; - } - } //end of task - } - // Coarse nodes in same theta (2i+1, 2j) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; TODO: Correct comment - for (int j = 1; j <= nr_int - 1; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double val; - for (int i = 0; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - - // Previous coarse node (bottom) - col = (j - 1) * ntheta_int / 4 + i / 2; - val = 0.5; // 1/2 - Pu[row] += val * u[col]; - - // Next coarse node (top) - col = (j + 1) * ntheta_int / 4 + i / 2; - val = 0.5; // 1/2 - Pu[row] += val * u[col]; - } - } //end of task - } - // Coarse nodes in diagonals (2i+1, 2j+1) - // => nb_nodes = ntheta_int * (nr_int / 2 - 2) / 2; TODO: Correct comment - for (int j = 1; j <= nr_int - 1; j += 2) { -#pragma omp task firstprivate(j) shared(iplus_vect, Pu) - { - int row, col; - double val; - for (int i = 1; i < ntheta_int; i += 2) { - row = j * ntheta_int + i; - - // no top_right - // top_left - col = (j + 1) * ntheta_int / 4 + (i - 1) / 2; - val = 0.5; // isotrop: 1/4 - Pu[row] += val * u[col]; - - // bottom_right - col = (j - 1) * ntheta_int / 4 + iplus_vect[i] / 2; - val = 0.5; // isotrop: 1/4 - Pu[row] += val * u[col]; - // no bottom_left - } - } //end of task - } - } //end of single - } //end of parallel - - return Pu; -} /* ----- end of level::apply_prolongation_ex ----- */ - -/*! - * \brief Applies the extrapolation operator - * - * Applies the prolongation operator for implicit extrapolation. - * - * The stencil is the same as the isotropic bilinear interpolation stencil, - * except for fine points with diagonal coarse neighboors (types 5,6,7) where only - * top_left and top_right values are used. - * - */ -std::vector level::apply_restriction_ex(std::vector u) -{ - //Restriction (P^T * u = Pu), (mc x m) * m = mc - std::vector Pu = std::vector(mc, 0); - - std::vector iplus_vect(ntheta_int); - for (int i = 0; i < ntheta_int - 1; i++) - iplus_vect[i] = i + 1; - iplus_vect[ntheta_int - 1] = 0; - std::vector imoins_vect(ntheta_int); - for (int i = 1; i < ntheta_int; i++) - imoins_vect[i] = i - 1; - imoins_vect[0] = ntheta_int - 1; - -#pragma omp parallel shared(iplus_vect) - { -#pragma omp single - { - // // Loop through all coarse nodes - int jc = 0; -#pragma omp task firstprivate(jc) shared(iplus_vect, imoins_vect, Pu) - { - int row, col, i, j, i_f, j_f; - double val; - for (int ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - - // // Fine nodes in same r (2i, 2j+1) - // Next fine node (right) - i = iplus_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (left) - i = imoins_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in same theta (2i+1, 2j) - // Next fine node (top) - i = i_f; - j = j_f + 1; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in diagonals (2i+1, 2j+1) - // no bottom_left - // no bottom_right - // top_left - i = imoins_vect[i_f]; - j = j_f + 1; - row = j * ntheta_int + i; - val = 0.5; // isotrop: 1/4 - Pu[col] += val * u[row]; - // no top_right - } - } //end of task - jc = nr_int / 2; -#pragma omp task firstprivate(jc) shared(iplus_vect, imoins_vect, Pu) - { - int row, col, i, j, i_f, j_f; - double val; - for (int ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - - // // Fine nodes in same r (2i, 2j+1) - // Next fine node (right) - i = iplus_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (left) - i = imoins_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in same theta (2i+1, 2j) - // Previous fine node (bottom) - i = i_f; - j = j_f - 1; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in diagonals (2i+1, 2j+1) - // no bottom_left - // bottom_right - i = iplus_vect[i_f]; - j = j_f - 1; - row = j * ntheta_int + i; - val = 0.5; // isotrop: 1/4 - Pu[col] += val * u[row]; - // no top_left - // no top_right - } - } //end of task - // => nb_nodes = ntheta_int * (nr_int / 2 + 1) / 2; TODO: Correct comment - for (int jc = 1; jc < nr_int / 2; jc++) { -#pragma omp task firstprivate(jc) shared(iplus_vect, imoins_vect, Pu) - { - int row, col, i, j, i_f, j_f; - double val; - for (int ic = 0; ic < ntheta_int / 2; ic++) { - col = jc * ntheta_int / 2 + ic; - i_f = ic * 2; - j_f = jc * 2; - - // // Coarse nodes - i = i_f; - j = j_f; - row = j * ntheta_int + i; - val = 1.0; - Pu[col] += val * u[row]; - - // // Fine nodes in same r (2i, 2j+1) - // Next fine node (right) - i = iplus_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (left) - i = imoins_vect[i_f]; - j = j_f; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in same theta (2i+1, 2j) - // Next fine node (top) - i = i_f; - j = j_f + 1; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - // Previous fine node (bottom) - i = i_f; - j = j_f - 1; - row = j * ntheta_int + i; - val = 0.5; // 1/2 - Pu[col] += val * u[row]; - - // // Fine nodes in diagonals (2i+1, 2j+1) - // no bottom_left - // bottom_right - i = iplus_vect[i_f]; - j = j_f - 1; - row = j * ntheta_int + i; - val = 0.5; // isotrop: 1/4 - Pu[col] += val * u[row]; - // top_left - i = imoins_vect[i_f]; - j = j_f + 1; - row = j * ntheta_int + i; - val = 0.5; // isotrop: 1/4 - Pu[col] += val * u[row]; - // no top_right - } - } //end of task - } - } //end of single - } //end of parallel - - return Pu; -} /* ----- end of level::apply_restriction_ex ----- */ diff --git a/src/smoother.cpp b/src/smoother.cpp deleted file mode 100644 index 0c183373..00000000 --- a/src/smoother.cpp +++ /dev/null @@ -1,4689 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/*! - * \file multigrid_iter.cpp - * \brief Implementation of the smoother - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ - -#include "level.h" -#include - -/*! - * \brief Returns the index i+1 in (0, ntheta) - * - * Returns (i + 1) % ntheta_int - * - * \param i: theta index - * \param ntheta_int: size of theta - * - * \return (i + 1) % ntheta_int - * - */ -inline int iplus(int i, int ntheta_int) -{ - return (i + 1 > ntheta_int - 1) ? 0 : i + 1; -} /* ----- end of inline iplus ----- */ - -/*! - * \brief Returns the index i-1 in (0, ntheta) - * - * Returns (i + ntheta_int - 1) % ntheta_int - * - * \param i: theta index - * \param ntheta_int: size of theta - * - * \return (i + ntheta_int - 1) % ntheta_int - * - */ -inline int imoins(int i, int ntheta_int) -{ - return (i - 1 < 0) ? ntheta_int - 1 : i - 1; -} /* ----- end of inline imoins ----- */ - -/*! - * \brief Defines the smoother - * - * Defines the smoother - * so far only different types of zebra splittings are implemented - * (basically, two colors, although more can be defined but which might not be used) - * - */ -void level::define_line_splitting() -{ - // useless array q - int i; - for (i = 2; i < nr_int - 2; i++) { - // assume that k_ij=theta_{i,j+1}-theta_{i,j} is constant for fixed i and variable j (i.e., constant per circle) - double q = (theta[1] - theta[0]) / (r[i] - r[i - 1]); - if (r[i] > 1 / q) - break; - } - delete_circles = i; // delete_circles = delete_circles(end); - - if (gyro::icntl[Param::verbose] > 2) - std::cout << "Shifting from circle to radial at radius " << delete_circles << "\n"; -} /* ----- end of destructor level::define_line_splitting ----- */ - -/*! \brief Applies smoothing - * - * For all lines of the smoother s and the colour c. - * The matrix A_sc is for all lines of points of the smoother s/c. - * The result is in u (or u_previous_cu_previous_r). - * - * if gyro::icntl[Param::smoother]= - * - 3: block Gauss Seidel for all 4 smoothers. - * - 13: block Jacobi between Circle and Radial, and block Gauss Seidel for B/W inside each. - * - * \param smoother: the smoother -*/ -void level::multigrid_smoothing(int smoother, int v, std::vector& f_Asc_u, int nblocks, int c, int* dep_Asc_cur, - int* dep_Asc_prev, int* dep_Asc1, int* dep_Asc_ortho_cur) -{ - double t, t_smoothing_tmp; - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - - TIC; - t_smoothing_tmp = t; - - if (gyro::icntl[Param::matrix_free] == 1) { - apply_Asc_ortho(f_Asc_u, u, smoother, v, c, dep_Asc_cur, dep_Asc_prev, dep_Asc1, dep_Asc_ortho_cur); - } - else { - /* if (gyro::icntl[Param::openmp] == 1) { - for (auto k = 0; k < A_Zebra_Mix_r[smoother].size(); k++) { - f_Asc_u[A_Zebra_Mix_r[smoother][k]] -= A_Zebra_Mix_v[smoother][k] * u[A_Zebra_Mix_c[smoother][k]]; - } - } - else { -*/ - if (smoother < 2) { - int start_j = 0; - if (gyro::icntl[Param::DirBC_Interior]) - start_j = 1; - - int start; - if (smoother == 0) - start = (gyro::icntl[Param::DirBC_Interior]) ? 2 : 0; - else if (smoother == 1) - start = 1; - int shift = 2; - for (int j = start; j < delete_circles; j += shift) { - int odd_j = j % 2; -#pragma omp task shared(u, f_Asc_u) firstprivate(smoother, j, odd_j) depend(in \ - : dep_Asc_prev[j - odd_j]), \ - depend(in \ - : dep_Asc_prev[j + odd_j]), \ - depend(out \ - : dep_Asc_ortho_cur[j]) - { - int smoother_tmp = get_smoother(0, j); - std::vector ptr_vect = get_ptr_sc(j, smoother_tmp, 1); - int ptr_start = ptr_vect[0]; - int ptr_end = ptr_start + (ptr_vect[2] - ptr_vect[0]) * ntheta_int / 2; - for (int k = ptr_start; k < ptr_end; k++) { - f_Asc_u[A_Zebra_Mix_r[smoother][k]] -= - A_Zebra_Mix_v[smoother][k] * u[A_Zebra_Mix_c[smoother][k]]; - } - dep_Asc_ortho_cur[j] = 1; - } - } - } - else { - std::vector shift_vect, ptr_vect; - if (smoother == 2) { - ptr_vect = ptr_vect_s2; - shift_vect = shift_vect_s2; - } - else { - ptr_vect = ptr_vect_s3; - shift_vect = shift_vect_s3; - } - for (int i = smoother - 2; i < ntheta_int; i += 2) { - int im = imoins(i, ntheta_int); - int ip = iplus(i, ntheta_int); - int odd_d = delete_circles % 2; - int ind_m_odd = i, ind_p_odd = i; - int odd_i = i % 2; - if (odd_i) { - ind_m_odd = im; - ind_p_odd = ip; - } -#pragma omp task shared(u, f_Asc_u) firstprivate(smoother, i, odd_d, ind_m_odd, ind_p_odd) \ - depend(in \ - : dep_Asc_prev[ind_m_odd]) depend(in \ - : dep_Asc_prev[ind_p_odd], dep_Asc1[delete_circles - 1 - odd_d]) \ - depend(out \ - : dep_Asc_ortho_cur[i]) - { - int start_s2_extr = (smoother == 2 && extrapol && delete_circles % 2 == 0) ? 1 : 0; - int shift_s2_extr = (smoother == 2 && extrapol) ? 2 : 1; - for (int j = delete_circles + start_s2_extr; j < nr_int; j += shift_s2_extr) { - for (int k = - ptr_vect[j - delete_circles] + (i - smoother + 2) / 2 * shift_vect[j - delete_circles]; - k < ptr_vect[j - delete_circles] + - ((i - smoother + 2) / 2 + 1) * shift_vect[j - delete_circles]; - k++) { - f_Asc_u[A_Zebra_Mix_r[smoother][k]] -= - A_Zebra_Mix_v[smoother][k] * u[A_Zebra_Mix_c[smoother][k]]; - } - } - dep_Asc_ortho_cur[i] = 1; - } - } - } - // } - } - - t_Asc_ortho += TOC; - TIC; - - /* if (gyro::icntl[Param::openmp] == 1) { - for (int k = 0; k < nblocks; k++) { - int ij_glob = k * 2 + smoother % 2; - int ind = ij_glob, indm = ij_glob - 1, indp = ij_glob + 1; - if (smoother > 1 && gyro::icntl[Param::matrix_free] == 1) { - indm = imoins(ij_glob, ntheta_int); - indp = iplus(ij_glob, ntheta_int); - } - TIC; - // create u_sc, f_sc - std::vector u_sc; - std::vector f_sc(m_sc[smoother]); - std::vector f_total(m_sc[smoother]), f_total2(m_sc[smoother]); - - std::vector::const_iterator first = f_Asc_u.begin() + k * m_sc[smoother]; - std::vector::const_iterator last = f_Asc_u.begin() + (k + 1) * m_sc[smoother]; - f_total = std::vector(first, last); - for (int i = 0; i < m_sc[smoother]; i++) - f_Asc_u[k * m_sc[smoother] + i] = 0; - - //compute f_total = f_sc - A_sc_ortho * u - build_fsc(f_sc, fVec, smoother, 0, k * m_sc[smoother], (k + 1) * m_sc[smoother]); - for (int i = 0; i < m_sc[smoother]; i++) { - f_sc[i] += f_total[i]; - } - - // #pragma omp atomic - t_f_sc += TOC; - TIC; - - // Dirichlet or size of system is 1 (diagonal solve) - if ((smoother == 0 && k == 0 && gyro::icntl[Param::DirBC_Interior]) || m_sc[smoother] == 1 || - (gyro::icntl[Param::extrapolation] && l == 0 && smoother % 2 == 0 && - !(smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && k == 0))) { - u_sc = solve_diag(A_Zebra_v_LU_row[smoother][k], f_sc); - } - // Circle (not across) - else if (smoother < 2 && !(smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && k == 0)) { - u_sc = solve_circle(A_Zebra_r_LU_row[smoother][k], A_Zebra_c_LU_row[smoother][k], - A_Zebra_v_LU_row[smoother][k], f_sc); - } - // Radial (not across) - else if (smoother > 1) { - u_sc = solve_radial(A_Zebra_r_LU_row[smoother][k], A_Zebra_c_LU_row[smoother][k], - A_Zebra_v_LU_row[smoother][k], f_sc); - } - // Across (direct solver) - else { -#ifdef GMGPOLAR_USE_MUMPS - if (gyro::icntl[Param::optimized] == 0) { -#endif - u_sc = solve_gaussian_elimination(A_Zebra_r_LU_row[smoother][k], A_Zebra_c_LU_row[smoother][k], - A_Zebra_v_LU_row[smoother][k], f_sc); -#ifdef GMGPOLAR_USE_MUMPS - } - else - u_sc = solve_mumps(mumps_across, f_sc); -#endif - } - - t_Asc += TOC; - TIC; - - build_fsc(u_sc, u, smoother, 1, k * m_sc[smoother], (k + 1) * m_sc[smoother]); - - t_f_sc += TOC; - TIC; - } - } - else { -*/ - for (int k = 0; k < nblocks; k++) { - int ij_glob = k * 2 + smoother % 2; - int ind = ij_glob, indm = ij_glob - 1, indp = ij_glob + 1; - if (smoother > 1 && gyro::icntl[Param::matrix_free] == 1) { - indm = imoins(ij_glob, ntheta_int); - indp = iplus(ij_glob, ntheta_int); - } -#pragma omp task firstprivate(k, ij_glob, ind, indm, indp, t) shared(f_Asc_u) \ - depend(in \ - : dep_Asc_ortho_cur[indm], dep_Asc_ortho_cur[ind], dep_Asc_ortho_cur[indp]) depend(out \ - : dep_Asc_cur[ind]) - { - TIC; - // create u_sc, f_sc - std::vector u_sc; - std::vector f_sc(m_sc[smoother]); - std::vector f_total(m_sc[smoother]), f_total2(m_sc[smoother]); - - std::vector::const_iterator first = f_Asc_u.begin() + k * m_sc[smoother]; - std::vector::const_iterator last = f_Asc_u.begin() + (k + 1) * m_sc[smoother]; - f_total = std::vector(first, last); - for (int i = 0; i < m_sc[smoother]; i++) - f_Asc_u[k * m_sc[smoother] + i] = 0; - - //compute f_total = f_sc - A_sc_ortho * u - build_fsc(f_sc, fVec, smoother, 0, k * m_sc[smoother], (k + 1) * m_sc[smoother]); - for (int i = 0; i < m_sc[smoother]; i++) { - f_sc[i] += f_total[i]; - } - - // #pragma omp atomic - t_f_sc += TOC; - TIC; - - // Dirichlet or size of system is 1 (diagonal solve) - if ((smoother == 0 && k == 0 && gyro::icntl[Param::DirBC_Interior]) || m_sc[smoother] == 1 || - (gyro::icntl[Param::extrapolation] && l == 0 && smoother % 2 == 0 && - !(smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && k == 0))) { - u_sc = solve_diag(A_Zebra_v_LU_row[smoother][k], f_sc); - } - // Circle (not across) - else if (smoother < 2 && !(smoother == 0 && !gyro::icntl[Param::DirBC_Interior] && k == 0)) { - u_sc = solve_circle(A_Zebra_r_LU_row[smoother][k], A_Zebra_c_LU_row[smoother][k], - A_Zebra_v_LU_row[smoother][k], f_sc); - } - // Radial (not across) - else if (smoother > 1) { - u_sc = solve_radial(A_Zebra_r_LU_row[smoother][k], A_Zebra_c_LU_row[smoother][k], - A_Zebra_v_LU_row[smoother][k], f_sc); - } - // Across (direct solver) - else { -#ifdef GMGPOLAR_USE_MUMPS - if (gyro::icntl[Param::optimized] == 0) { -#endif - u_sc = solve_gaussian_elimination(A_Zebra_r_LU_row[smoother][k], A_Zebra_c_LU_row[smoother][k], - A_Zebra_v_LU_row[smoother][k], f_sc); -#ifdef GMGPOLAR_USE_MUMPS - } - else - u_sc = solve_mumps(mumps_across, f_sc); -#endif - } - -#pragma omp atomic - t_Asc += TOC; - TIC; - - build_fsc(u_sc, u, smoother, 1, k * m_sc[smoother], (k + 1) * m_sc[smoother]); - -#pragma omp atomic - t_f_sc += TOC; - TIC; - - dep_Asc_cur[ind] = 1; - } - // } - } - - t = t_smoothing_tmp; - t_smoothing += TOC; -} /* ----- end of level::multigrid_smoothing ----- */ - -/*! \brief Create the RHS part corresponding to Asc_ortho for a smoother (on level l) - * - * Create f_sc, i.e. the RHS part corresponding to Asc_ortho for a smoother (on level l) - * - * \param f_sc: the RHS part (out) - * \param smoother: the smoother -*/ -void level::build_fsc(std::vector& f_sc, std::vector& f, int smoother, int loc_to_glob, int start, - int end) -{ - std::vector ind = mapping_usc_to_u(start, end, smoother); - if (loc_to_glob) { - //computation of indices in the total vector u corresponding to the indices in u_sc - for (int i = start; i < end; ++i) { - int index = ind[i - start]; - f[index] = f_sc[i % m_sc[smoother]]; - } - } - else { - //computation of indices in the total vector u corresponding to the indices in u_sc - for (int i = start; i < end; ++i) { - int index = ind[i - start]; - f_sc[i % m_sc[smoother]] = f[index]; - } - } -} /* ----- end of level::build_fsc ----- */ - -/*! \brief Build the matrix A_sc explicitely on the level l - * - * Asc corresponds to all lines of a smoother s with colour c - * so we need to build 4 matrices Asc for the 4 smoothers on the level l, all stored in A_Zebra - * 0,1: circular white/black - * 2,3: radial white/black - * - * this function is called only once at the beginning to build the matrices Asc on all levels - * the matrix should contain only the parts corresponding to (s/c), - * thus it is not of size m, but smaller (number of points corresponding to the smoother s/c), - * so we need to treat the indices (!) -*/ -void level::build_Asc() -{ - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - int shift_ij = extrapol ? 1 : 0; - int smoother_prev, smoother_cur, smoother_next, smoother; - int start_j, start_loop, shift_loop, ip, im, ptr, row, col; - double coeff, coeff2, coeff3, kt, ktmin1, hs, hsmin1, beta_val; - - std::vector smoother23(ntheta_int); - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - std::vector> stencil23_prev(2), stencil23_cur(2), stencil23_next(2); - for (int i = 0; i < ntheta_int; i += 2) { - smoother23[i] = 2; - smoother23[i + 1] = 3; - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Circle Smoother !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // Take boundary condition into account: Dirichlet-RB - smoother = 0; - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary - for (int i = 0; i < ntheta_int / (shift_ij + 1); i++) { - A_Zebra_r_row[smoother][0][i] = i; - A_Zebra_c_row[smoother][0][i] = i; - A_Zebra_v_row[smoother][0][i] = 1.0; - } - start_j = 1; - } - else { // (r[0],0) is not on Dirichlet boundary - start_j = 0; - } - - for (int j = start_j; j < delete_circles; j++) { - /* Initialize moother, row_vect, ptr, and stencil */ - if (j > start_j) { - smoother_prev = smoother_cur; - smoother_cur = smoother_next; - row_vect_prev = row_vect; - row_vect = row_vect_next; - ptr_vect_prev = ptr_vect; - ptr_vect = ptr_vect_next; - stencil_prev = stencil_cur; - stencil_cur = stencil_next; - } - else { - smoother_cur = j; - row_vect = get_row(j, smoother_cur, extrapol, 1, 1); - ptr_vect = get_ptr_sc(j, smoother_cur, 0); - stencil_cur = get_stencil_sc(j, smoother_cur, 0); - } - if (j < delete_circles - 1) - smoother_next = get_smoother(0, j + 1); - else - smoother_next = 2; - row_vect_next = get_row(j + 1, smoother_next, extrapol, 1, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_next, 0); - if (j < delete_circles - 1) - stencil_next = get_stencil_sc(j + 1, smoother_next, 0); - else { - stencil23_next[0] = get_stencil_sc(j + 1, 2, 0); - stencil23_next[1] = get_stencil_sc(j + 1, 3, 0); - } - hs = hplus[j]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - - /* Update (j-1, i) */ - if (j > start_j) { - hsmin1 = hplus[j - 1]; - smoother = smoother_prev; - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - ptr = ptr_vect_prev[i]; - stencil = stencil_prev; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - col = row_vect_prev[i]; - - A_Zebra_v_row[smoother][(j - 1) / 2][ptr + stencil[Param::middle]] += coeff; - } - } - else { - smoother = smoother_cur; - stencil = stencil_cur; - // Across: bottom update - if (!gyro::icntl[Param::DirBC_Interior]) { - hsmin1 = 2 * r[0]; - arr_vect2 = gyro::arr(r[j], theta_PI, sin_theta_PI, cos_theta_PI, ntheta_int, 0); - for (int i = shift_ij; i < ntheta_int; i += shift_ij + 1) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect[i]; - row = row_vect[i]; - col = row_vect[(i + ntheta_int / 2) % ntheta_int]; - A_Zebra_r_row[smoother][j / 2][ptr + stencil[Param::bottom]] = row; - A_Zebra_c_row[smoother][j / 2][ptr + stencil[Param::bottom]] = col; - - coeff = 0.5 * (kt + ktmin1) * arr_vect2[i] / hsmin1; - coeff2 = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::bottom]] += -coeff - coeff2; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += coeff; - } - } - // Dirichlet - else { - hsmin1 = hplus[j - 1]; - // DB contribution arr (r(0)) - arr_vect2 = gyro::arr(r[j - 1], theta, sin_theta, cos_theta, ntheta_int, 0); - - for (int i = 0; i < ntheta_int; i++) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect[i]; - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect2[i] / hsmin1; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += coeff; - } - } - } - - /* Update (j, x) */ - smoother = smoother_cur; - if (!extrapol || smoother == 1) { - for (int i = 0; i < ntheta_int; i++) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - stencil = stencil_cur; - ip = iplus(i, ntheta_int); - im = imoins(i, ntheta_int); - - // Update (j, i) - ptr = ptr_vect[i]; - row = row_vect[i]; - A_Zebra_r_row[smoother][j / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][j / 2][ptr + stencil[Param::middle]] = row; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - col = row_vect[im]; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::left]] += -coeff2 / ktmin1; - col = row_vect[ip]; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::right]] += -coeff2 / kt; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + i]; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += beta_val; - - // Update (j, i+1) - ptr = ptr_vect[ip]; - row = row_vect[ip]; - col = row_vect[i]; - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - A_Zebra_r_row[smoother][j / 2][ptr + stencil[Param::left]] = row; - A_Zebra_c_row[smoother][j / 2][ptr + stencil[Param::left]] = col; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::left]] += -coeff; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) - ptr = ptr_vect[im]; - row = row_vect[im]; - col = row_vect[i]; - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - A_Zebra_r_row[smoother][j / 2][ptr + stencil[Param::right]] = row; - A_Zebra_c_row[smoother][j / 2][ptr + stencil[Param::right]] = col; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::right]] += -coeff; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += coeff; - } - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - stencil = stencil_cur; - ip = iplus(i, ntheta_int); - im = imoins(i, ntheta_int); - col = row_vect[i]; - - // Update (j, i+1) - ptr = ptr_vect[iplus(i, ntheta_int)]; - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - row = row_vect[ip]; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - row = row_vect[im]; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += coeff; - - // Update (j, i) [for i+1] - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - ptr = ptr_vect[i + 1]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - row = row_vect[i + 1]; - A_Zebra_r_row[smoother][j / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][j / 2][ptr + stencil[Param::middle]] = row; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + ip]; - - A_Zebra_v_row[smoother][j / 2][ptr + stencil[Param::middle]] += beta_val; - } - } - - /* Update (j+1, i) */ - if (j < delete_circles - 1) { - smoother = smoother_next; - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect_next[i]; - stencil = stencil_next; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - row = row_vect_next[i]; - - A_Zebra_v_row[smoother][(j + 1) / 2][ptr + stencil[Param::middle]] += coeff; - } - } - else if (j == delete_circles - 1) { - if (extrapol && (j + 1) % 2 == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect_next[i]; - smoother = smoother23[i]; - stencil = stencil23_next[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - row = row_vect_next[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += coeff; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Radial Smoother !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = delete_circles; j < nr_int; j++) { - /* Initialize moother, row_vect, ptr, and stencil */ - if (j == delete_circles) { - smoother_prev = get_smoother(0, j - 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev, 0); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 1, 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev, 0); - } - else { - stencil23_prev[0] = get_stencil_sc(j - 1, 2, 0); - stencil23_prev[1] = get_stencil_sc(j - 1, 3, 0); - row_vect_prev = get_row(j - 1, 2, extrapol, 1, 1); - ptr_vect_prev = get_ptr_sc(j - 1, 2, 0); - } - row_vect = row_vect_next; - ptr_vect = ptr_vect_next; - stencil23_cur[0] = get_stencil_sc(j, 2, 0); - stencil23_cur[1] = get_stencil_sc(j, 3, 0); - if (j < nr_int - 1) { - row_vect_next = get_row(j + 1, 2, extrapol, 1, 1); - ptr_vect_next = get_ptr_sc(j + 1, 2, 0); - stencil23_next[0] = get_stencil_sc(j + 1, 2, 0); - stencil23_next[1] = get_stencil_sc(j + 1, 3, 0); - } - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (j == nr_int - 1) - arr_vect2 = gyro::arr(r[j + 1], theta, sin_theta, cos_theta, ntheta_int, 0); - /* Update (j-1, i) */ - if (j == delete_circles) { - smoother = smoother_prev; - stencil = stencil_prev; - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - ptr = ptr_vect_prev[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - row = row_vect_prev[i]; - - A_Zebra_v_row[smoother][(j - 1) / 2][ptr + stencil[Param::middle]] += coeff; - } - } - else { - if (extrapol) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - - ptr = ptr_vect_prev[i]; - stencil = stencil23_prev[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - row = row_vect_prev[i]; - col = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::top]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::top]] = col; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::top]] += -coeff; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += coeff; - } - start_loop = 0; - shift_loop = 2; - if (extrapol && j % 2 == 0) { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - - ptr = ptr_vect_prev[i]; - stencil = stencil23_prev[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - row = row_vect_prev[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += coeff; - } - } - } - - /* Update (j, x) */ - if (extrapol) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - if (j == delete_circles) { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - // Update (j, i) - ptr = ptr_vect[i]; - stencil = stencil23_cur[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - row = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - col = row_vect_prev[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::top]] += -coeff / hs; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += beta_val; - } - } - else if (j == nr_int - 1) { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - - // Update (j, i) - ptr = ptr_vect[i]; - stencil = stencil23_cur[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (kt + ktmin1) * arr_vect2[i] / hs; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - row = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - col = row_vect_next[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::bottom]] += -coeff / hsmin1; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += - coeff / hsmin1 + coeff / hs + coeff3 + coeff2 / ktmin1 + coeff2 / kt; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += beta_val; - } - } - else { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - - // Update (j, i) - ptr = ptr_vect[i]; - stencil = stencil23_cur[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - row = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - col = row_vect_next[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::top]] += -coeff / hs; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - col = row_vect_prev[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::bottom]] += -coeff / hsmin1; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += beta_val; - } - } - start_loop = 0; - shift_loop = 2; - if (extrapol && j % 2 == 1) { - if (j == nr_int - 1) { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - smoother = smoother23[i]; - stencil = stencil23_cur[smoother - 2]; - ptr = ptr_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (kt + ktmin1) * arr_vect2[i] / hs; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - row = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += - coeff / hsmin1 + coeff / hs + coeff3 + coeff2 / ktmin1 + coeff2 / kt; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += beta_val; - } - } - else { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - smoother = smoother23[i]; - stencil = stencil23_cur[smoother - 2]; - ptr = ptr_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i]; - row = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::middle]] = row; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += - coeff / hs + coeff / hsmin1 + coeff2 / ktmin1 + coeff2 / kt; - - // Beta coefficient - beta_val = betaVec[j * ntheta_int + i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += beta_val; - } - } - } - if (extrapol && j % 2 == 0) { - start_loop = 0; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ip = iplus(i, ntheta_int); - im = imoins(i, ntheta_int); - smoother = smoother23[ip]; - stencil = stencil23_cur[smoother - 2]; - - // Update (j, i+1) - ptr = ptr_vect[ip]; - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / kt; - row = row_vect[ip]; - - A_Zebra_v_row[smoother][ip / 2][ptr + stencil[Param::middle]] += coeff; - - // Update (j, i-1) - smoother = smoother23[im]; - ptr = ptr_vect[im]; - coeff = 0.5 * (hs + hsmin1) * att_vect[i] / ktmin1; - row = row_vect[im]; - - A_Zebra_v_row[smoother][im / 2][ptr + stencil[Param::middle]] += coeff; - } - - /* Update (j+1, i) */ - if (j < nr_int - 1) { - if (extrapol) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - - ptr = ptr_vect_next[i]; - stencil = stencil23_next[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - row = row_vect_next[i]; - col = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr + stencil[Param::bottom]] = row; - A_Zebra_c_row[smoother][i / 2][ptr + stencil[Param::bottom]] = col; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::bottom]] += -coeff; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += coeff; - } - start_loop = 0; - shift_loop = 2; - if (extrapol && j % 2 == 0) { - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother = smoother23[i]; - - ptr = ptr_vect_next[i]; - stencil = stencil23_next[smoother - 2]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - row = row_vect_next[i]; - - A_Zebra_v_row[smoother][i / 2][ptr + stencil[Param::middle]] += coeff; - } - } - } - } - - // Take boundary condition into account: Dirichlet-RB - int j = nr_int; - ptr_vect = get_ptr_sc(j, 2, 0); - row_vect = get_row(j, 2, extrapol, 1, 1); - for (int i = shift_ij; i < ntheta_int; i += shift_ij + 1) { - ptr = ptr_vect[i]; - smoother = smoother23[i]; - // row = get_row_radial(i, nr_int, smoother, extrapol, ntheta_int, delete_circles); - row = row_vect[i]; - A_Zebra_r_row[smoother][i / 2][ptr] = row; - A_Zebra_c_row[smoother][i / 2][ptr] = row; - A_Zebra_v_row[smoother][i / 2][ptr] += 1.0; - } -} /* ----- end of level::build_Asc ----- */ - -/*! \brief Applies the matrix A_sc_ortho for a smoother explicitely on the level l - * - * Asc_ortho corresponds to all lines of a smoother s with colour c and the columns not in Asc - * - * \param smoother_todo: the smoother of this Asc_ortho matrix -*/ -void level::build_Asc_ortho(int smoother_todo) -{ - int start_j, j, odd_j; - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - - int smoother = smoother_todo; - int smoother_prev, smoother_cur, smoother_next; - int smoother_prev_circle, smoother_cur_left, smoother_cur_circle, smoother_cur_right, smoother_next_circle; - int start_loop, shift_loop; - int row, row2, col, col2, ptr; - double coeff, coeff2, coeff3, kt, ktmin1, hs, hsmin1, val, val2; - int base_prec; - if (smoother == 1) - base_prec = delete_circles + 1; - else if (smoother == 0) - base_prec = -(delete_circles + 1); - else if (smoother == 3) - base_prec = ntheta_int; - else if (smoother == 2) - base_prec = -ntheta_int; - - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector ptr_vect_prev, ptr_vect, ptr_vect_next; - std::vector stencil_prev, stencil_cur, stencil_cur_left, stencil_cur_right, stencil_next, stencil; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Circle Smoother !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // Take boundary condition into account: Dirichlet-RB - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary - dep_Asc_ortho[0][0] = 1; - dep_Asc_ortho[1][0] = 1; - start_j = 1; - } - else { // (r[0],0) is not on Dirichlet boundary - start_j = 0; - } - - if (smoother < 2) { - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (circle) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles; - odd_j = j % 2; - - smoother_prev = get_smoother(0, j - 1); - smoother_vect = get_smoother_radial(j); - smoother_vect_next = get_smoother_radial(j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev, 1); - ptr_vect = get_ptr_sc(j, smoother_vect[0], 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_vect_next[0], 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev, 1); - stencil_cur = get_stencil_sc(j, smoother_vect[0], 1); - stencil_next = get_stencil_sc(j + 1, smoother_vect_next[0], 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, 2, extrapol, 0, 1); - row_vect_next = get_row(j + 1, 2, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_prev == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - stencil = stencil_prev; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect_prev[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect_prev[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] += val2; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - odd_j = j % 2; - - if (delete_circles > 2 || !gyro::icntl[Param::DirBC_Interior]) { - smoother_prev = get_smoother(0, j - 1); - smoother_cur = get_smoother(0, j); - smoother_vect_next = get_smoother_radial(j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev, 1); - ptr_vect = get_ptr_sc(j, smoother_cur, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_vect_next[0], 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev, 1); - stencil_cur = get_stencil_sc(j, smoother_cur, 1); - stencil_next = get_stencil_sc(j + 1, smoother_vect_next[0], 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - row_vect_next = get_row(j + 1, 2, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - stencil = stencil_cur; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val2; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - ptr = ptr_vect[iplus(i, ntheta_int)]; - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val; - - ptr = ptr_vect[i + 1]; - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val2; - } - } - } - else if (smoother_prev == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - stencil = stencil_prev; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect_prev[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother_cur == smoother) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - stencil = stencil_cur; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - ptr = ptr_vect[iplus(i, ntheta_int)]; - row = row_vect[iplus(i, ntheta_int)]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val2; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - row2 = row_vect[imoins(i, ntheta_int)]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] -= val; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] -= val2; - } - } - else if (smoother_prev == smoother) { - stencil = stencil_prev; - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect_prev[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] += val2; - } - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = delete_circles - 2; j > start_j; j--) { - odd_j = j % 2; - - smoother_prev = get_smoother(0, j - 1); - smoother_cur = get_smoother(0, j); - smoother_next = get_smoother(0, j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev, 1); - ptr_vect = get_ptr_sc(j, smoother_cur, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_next, 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev, 1); - stencil_cur = get_stencil_sc(j, smoother_cur, 1); - stencil_next = get_stencil_sc(j + 1, smoother_next, 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - row_vect_next = get_row(j + 1, smoother_next, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - stencil = stencil_cur; - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val2; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - ptr = ptr_vect[iplus(i, ntheta_int)]; - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val; - - // Update (j, i) - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - ptr = ptr_vect[iplus(i, ntheta_int)]; - - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val2; - // ??? - } - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - stencil = stencil_prev; - ptr = ptr_vect_prev[i]; - - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - - // Update (j+1, i) - stencil = stencil_next; - ptr = ptr_vect_next[i]; - - row = row_vect_next[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother_cur == smoother) { - stencil = stencil_cur; - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - ptr = ptr_vect[iplus(i, ntheta_int)]; - row = row_vect[iplus(i, ntheta_int)]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val2; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - row2 = row_vect[imoins(i, ntheta_int)]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] -= val; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] -= val2; - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - stencil = stencil_prev; - ptr = ptr_vect_prev[i]; - - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] += val2; - - // Update (j+1, i) - stencil = stencil_next; - ptr = ptr_vect_next[i]; - - row = row_vect_next[i]; - val = -art_vect[i]; - val2 = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] += val2; - } - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! First lines !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = start_j; - odd_j = j % 2; - - smoother_cur = j; - ptr_vect = get_ptr_sc(j, smoother_cur, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - if (j < delete_circles - 1) { - smoother_next = (j + 1) % 2; - row_vect_next = get_row(j + 1, smoother_next, extrapol, 0, 1); - } - else if (j == delete_circles - 1) { - smoother_vect_next = get_smoother_radial(j + 1); - smoother_next = smoother_vect_next[0]; - row_vect_next = get_row(j + 1, 2, extrapol, 0, 1); - } - ptr_vect_next = get_ptr_sc(j + 1, smoother_next, 1); - stencil_cur = get_stencil_sc(j, smoother_cur, 1); - stencil_next = get_stencil_sc(j + 1, smoother_next, 1); - - hs = hplus[j]; - if (j > 0) { - hsmin1 = hplus[j - 1]; - } - else { - hsmin1 = 2 * r[0]; // across the origin - } - // Across and DB_int updates - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - stencil = stencil_cur; - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - ptr = ptr_vect[iplus(i, ntheta_int)]; - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - - // Update (j, i) - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - ptr = ptr_vect[i + 1]; - - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::left]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val2; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - ptr = ptr_vect[iplus(i, ntheta_int)]; - row = row_vect[iplus(i, ntheta_int)]; - col = (j + 1) * ntheta_int + i; - val = art_vect[i]; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val; - - // Update (j, i-1) - ptr = ptr_vect[imoins(i, ntheta_int)]; - row = row_vect[imoins(i, ntheta_int)]; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] -= val; - } - } - } - - // Update (j+1, i) - if (j < delete_circles - 1 && smoother_next == smoother) { - stencil = get_stencil_sc(j + 1, smoother, 1); - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - ptr = ptr_vect_next[i]; - - row = row_vect_next[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - - val = -coeff; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - ptr = ptr_vect_next[i]; - - row = row_vect_next[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = -art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = art_vect[i]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] += val2; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! RADIAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - if (smoother > 1) { - int diff = ntheta_int % 3; - int odd_d = delete_circles % 2; - - for (int i = 0; i < ntheta_int; i++) { - { - int im = imoins(i, ntheta_int); - int ip = iplus(i, ntheta_int); - int im2 = imoins(im, ntheta_int); - int ip2 = iplus(ip, ntheta_int); - int odd_i = i % 2; - int ind_m_odd = i, ind_p_odd = i; - if (odd_i) { - ind_m_odd = im; - ind_p_odd = ip; - } - - int s_cur = (i % 2) + 2; - int s_next = ((i + 1) % 2) + 2; - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother_cur = s_cur; - smoother_prev = s_next; - smoother_next = s_next; - row_vect_prev = get_row_i_glob(nr, im, smoother_prev, extrapol); - row_vect = get_row_i_glob(nr, i, smoother_cur, extrapol); - row_vect_next = get_row_i_glob(nr, ip, smoother_next, extrapol); - gyro::arr_att_art(r, theta[i], arr_vect, att_vect, art_vect, 0); - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - int smoother_prev_circle = get_smoother(i, j - 1); - int smoother_cur_left = get_smoother(im, j); - int smoother_cur_circle = get_smoother(i, j); - int smoother_cur_right = get_smoother(ip, j); - int smoother_next_circle = get_smoother(i, j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev_circle, 1); - ptr_vect = get_ptr_sc(j, smoother_cur_circle, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_next_circle, 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev_circle, 1); - stencil_cur_left = get_stencil_sc(j, smoother_cur_left, 1); - stencil_cur = get_stencil_sc(j, smoother_cur_circle, 1); - stencil_cur_right = get_stencil_sc(j, smoother_cur_right, 1); - stencil_next = get_stencil_sc(j + 1, smoother_next_circle, 1); - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - stencil = stencil_next; - ptr = ptr_vect_next[i]; - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += -coeff; - - if (gyro::icntl[Param::mod_pk] > 0) { - stencil = stencil_next; - ptr = ptr_vect_next[i]; - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] += val2; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - - j = delete_circles; - smoother_prev_circle = get_smoother(i, j - 1); - smoother_cur_left = get_smoother(im, j); - smoother_cur_circle = get_smoother(i, j); - smoother_cur_right = get_smoother(ip, j); - smoother_next_circle = get_smoother(i, j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev_circle, 1); - ptr_vect = get_ptr_sc(j, smoother_cur_circle, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_next_circle, 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev_circle, 1); - stencil_cur_left = get_stencil_sc(j, smoother_cur_left, 1); - stencil_cur = get_stencil_sc(j, smoother_cur_circle, 1); - stencil_cur_right = get_stencil_sc(j, smoother_cur_right, 1); - stencil_next = get_stencil_sc(j + 1, smoother_next_circle, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - stencil = stencil_cur; - ptr = ptr_vect[i]; - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val2; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - stencil = stencil_cur; - // Update (j, i+1) - stencil = stencil_cur_right; - ptr = ptr_vect[ip]; - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / kt; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - - // Update (j, i-1) - stencil = stencil_cur_left; - ptr = ptr_vect[im]; - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / ktmin1; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += -coeff; - } - } - // Update (j+1, i) (Not in DB_ext) - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - stencil = stencil_cur; - ptr = ptr_vect[i]; - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - } - else { - stencil = stencil_next; - ptr = ptr_vect_next[i]; - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - stencil = stencil_cur_right; - ptr = ptr_vect[ip]; - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val2; - - // Update (j, i-1) - stencil = stencil_cur_left; - ptr = ptr_vect[im]; - row2 = row_vect_prev[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] -= val; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] -= val2; - } - } - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j+1, i) - stencil = stencil_next; - ptr = ptr_vect_next[i]; - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] += val2; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (j = delete_circles + 1; j < nr_int - 1; j++) { - smoother_prev_circle = get_smoother(i, j - 1); - smoother_cur_left = get_smoother(im, j); - smoother_cur_circle = get_smoother(i, j); - smoother_cur_right = get_smoother(ip, j); - smoother_next_circle = get_smoother(i, j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev_circle, 1); - ptr_vect = get_ptr_sc(j, smoother_cur_circle, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_next_circle, 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev_circle, 1); - stencil_cur_left = get_stencil_sc(j, smoother_cur_left, 1); - stencil_cur = get_stencil_sc(j, smoother_cur_circle, 1); - stencil_cur_right = get_stencil_sc(j, smoother_cur_right, 1); - stencil_next = get_stencil_sc(j + 1, smoother_next_circle, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - stencil = stencil_cur; - ptr = ptr_vect[i]; - row = row_vect[j]; - // coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val2; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - stencil = stencil_cur_right; - ptr = ptr_vect[ip]; - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - - // Update (j, i-1) - stencil = stencil_cur_left; - ptr = ptr_vect[im]; - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - // Update (j, i) - stencil = stencil_cur; - ptr = ptr_vect[i]; - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val2; - } - else { - - // Update (j-1, i) - stencil = stencil_prev; - ptr = ptr_vect_prev[i]; - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - - // Update (j+1, i) - stencil = stencil_next; - ptr = ptr_vect_next[i]; - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - stencil = stencil_prev; - ptr = ptr_vect_prev[i]; - row = row_vect[j - 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] += val2; - - // Update (j+1, i) - stencil = stencil_next; - ptr = ptr_vect_next[i]; - row2 = row_vect[j + 1]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] -= val; - - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row2; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] -= val2; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - stencil = stencil_cur_right; - ptr = ptr_vect[ip]; - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val2; - - // Update (j, i-1) - stencil = stencil_cur_left; - ptr = ptr_vect[im]; - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] -= val; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] -= val2; - } - } - } - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - j = nr_int - 1; - smoother_prev_circle = get_smoother(i, j - 1); - smoother_cur_left = get_smoother(im, j); - smoother_cur_circle = get_smoother(i, j); - smoother_cur_right = get_smoother(ip, j); - smoother_next_circle = get_smoother(i, j + 1); - ptr_vect_prev = get_ptr_sc(j - 1, smoother_prev_circle, 1); - ptr_vect = get_ptr_sc(j, smoother_cur_circle, 1); - ptr_vect_next = get_ptr_sc(j + 1, smoother_next_circle, 1); - stencil_prev = get_stencil_sc(j - 1, smoother_prev_circle, 1); - stencil_cur_left = get_stencil_sc(j, smoother_cur_left, 1); - stencil_cur = get_stencil_sc(j, smoother_cur_circle, 1); - stencil_cur_right = get_stencil_sc(j, smoother_cur_right, 1); - stencil_next = get_stencil_sc(j + 1, smoother_next_circle, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - // Update (j, i) - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - stencil = stencil_cur; - ptr = ptr_vect[i]; - row = row_vect[j]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff3 / ktmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - col2 = j * ntheta_int + ip; - val2 = -coeff3 / kt; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val2; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - stencil = stencil_cur; - // Update (j, i+1) - stencil = stencil_cur_right; - ptr = ptr_vect[ip]; - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::left]] += val; - - // Update (j, i-1) - stencil = stencil_cur_left; - ptr = ptr_vect[im]; - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::right]] += val; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 0) { - // Update (j-1, i) - stencil = stencil_prev; - ptr = ptr_vect_prev[i]; - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top]] += val; - } - else { - // Update (j, i) - stencil = stencil_cur; - ptr = ptr_vect[i]; - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom]] += val; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - stencil = stencil_prev; - ptr = ptr_vect_prev[i]; - row = row_vect[j - 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_left]] += val; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::top_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::top_right]] = col2; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::top_right]] += val2; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - stencil = stencil_cur; - // Update (j, i+1) - stencil = stencil_cur_right; - ptr = ptr_vect[ip]; - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_left]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_left]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_left]] += val; - - // Update (j, i-1) - stencil = stencil_cur_left; - ptr = ptr_vect[im]; - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - A_Zebra_Mix_r[smoother][ptr + stencil[Param::bottom_right]] = row; - A_Zebra_Mix_c[smoother][ptr + stencil[Param::bottom_right]] = col; - A_Zebra_Mix_v[smoother][ptr + stencil[Param::bottom_right]] -= val; - } - } - } - } - } - } -} /* ----- end of level::build_Asc_ortho ----- */ - -/*! \brief Applies the matrix A_sc_ortho for a smoother explicitely on the level l - * - * Asc_ortho corresponds to all lines of a smoother s with colour c and the columns not in Asc - * - * \param smoother_todo: the smoother of this Asc_ortho matrix -*/ -void level::apply_Asc_ortho(std::vector& Au, std::vector& u, int smoother_todo, int v, int c, - int* dep_Asc_cur, int* dep_Asc_prev, int* dep_Asc1, int* dep_Asc_ortho_cur) -{ - int start_j; - int extrapol = gyro::icntl[Param::extrapolation] == 1 && l == 0; - - int smoother = smoother_todo; - int base_prec; - if (smoother == 1) - base_prec = delete_circles + 1; - else if (smoother == 0) - base_prec = -(delete_circles + 1); - else if (smoother == 3) - base_prec = ntheta_int; - else if (smoother == 2) - base_prec = -ntheta_int; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Circle Smoother !!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // Take boundary condition into account: Dirichlet-RB - if (gyro::icntl[Param::DirBC_Interior]) { // (r[0],0) is on Dirichlet boundary - dep_Asc_ortho[0][0] = 1; - dep_Asc_ortho[1][0] = 1; - start_j = 1; - } - else { // (r[0],0) is not on Dirichlet boundary - start_j = 0; - } - - if (smoother < 2) { - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (circle) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - int j = delete_circles; - int odd_j = j % 2; - -#pragma omp task shared(u, Au) firstprivate(smoother, j, odd_j) depend(in \ - : dep_Asc_prev[j - 1]) \ - depend(out \ - : dep_Asc_ortho_cur[j]) - { - int start_loop, shift_loop; - int row, col, col2; - int smoother_prev; - double coeff, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - smoother_prev = get_smoother(0, j - 1); - smoother_vect = get_smoother_radial(j); - smoother_vect_next = get_smoother_radial(j + 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, 2, extrapol, 0, 1); - row_vect_next = get_row(j + 1, 2, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_prev == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - dep_Asc_ortho_cur[j] = 1; - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - odd_j = j % 2; -#pragma omp task shared(u, Au) firstprivate(smoother, j, odd_j) depend(in \ - : dep_Asc_prev[j - odd_j]) \ - depend(in \ - : dep_Asc_ortho_cur[j + 1]) depend(out \ - : dep_Asc_ortho_cur[j]) - { - int start_loop, shift_loop; - int row, row2, col, col2; - int smoother_prev, smoother_cur; - double coeff, coeff2, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - if (delete_circles > 2 || !gyro::icntl[Param::DirBC_Interior]) { - smoother_prev = get_smoother(0, j - 1); - smoother_cur = get_smoother(0, j); - smoother_vect_next = get_smoother_radial(j + 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - row_vect_next = get_row(j + 1, 2, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - else if (smoother_prev == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother_cur == smoother) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - row2 = row_vect[imoins(i, ntheta_int)]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[i]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[i]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - else if (smoother_prev == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - } - dep_Asc_ortho_cur[j] = 1; - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes (1) !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = delete_circles - 4; j > start_j; j -= 3) { - odd_j = j % 2; -#pragma omp task shared(u, Au) firstprivate(smoother, j, odd_j) \ - depend(in \ - : dep_Asc_prev[j - odd_j], dep_Asc_prev[j + odd_j]) depend(out \ - : dep_Asc_ortho_cur[j]) - { - int start_loop, shift_loop; - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - smoother_prev = get_smoother(0, j - 1); - smoother_cur = get_smoother(0, j); - smoother_next = get_smoother(0, j + 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - row_vect_next = get_row(j + 1, smoother_next, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - - // Update (j, i) - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect_next[i]; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother_cur == smoother) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - row2 = row_vect[imoins(i, ntheta_int)]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[i]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[i]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - - // Update (j+1, i) - row = row_vect_next[i]; - val = -art_vect[i]; - val2 = art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - } - dep_Asc_ortho_cur[j] = 1; - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes (2) !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = delete_circles - 2; j > start_j; j -= 3) { - odd_j = j % 2; -#pragma omp task shared(u, Au) firstprivate(smoother, j, odd_j) \ - depend(in \ - : dep_Asc_prev[j - odd_j], dep_Asc_prev[j + odd_j], dep_Asc_ortho_cur[j + 1]) \ - depend(in \ - : dep_Asc_ortho_cur[j - 2]) depend(out \ - : dep_Asc_ortho_cur[j]) - { - int start_loop, shift_loop; - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - smoother_prev = get_smoother(0, j - 1); - smoother_cur = get_smoother(0, j); - smoother_next = get_smoother(0, j + 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - row_vect_next = get_row(j + 1, smoother_next, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - - // Update (j, i) - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect_next[i]; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother_cur == smoother) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - row2 = row_vect[imoins(i, ntheta_int)]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[i]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[i]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - - // Update (j+1, i) - row = row_vect_next[i]; - val = -art_vect[i]; - val2 = art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - } - dep_Asc_ortho_cur[j] = 1; - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes (3) !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int j = delete_circles - 3; j > start_j; j -= 3) { - odd_j = j % 2; -#pragma omp task shared(u, Au) firstprivate(smoother, j, odd_j) \ - depend(in \ - : dep_Asc_prev[j - odd_j], dep_Asc_prev[j + odd_j], dep_Asc_ortho_cur[j + 1]) \ - depend(in \ - : dep_Asc_ortho_cur[j - 2]) depend(out \ - : dep_Asc_ortho_cur[j]) - { - int start_loop, shift_loop; - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - smoother_prev = get_smoother(0, j - 1); - smoother_cur = get_smoother(0, j); - smoother_next = get_smoother(0, j + 1); - row_vect_prev = get_row(j - 1, smoother_prev, extrapol, 0, 1); - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - row_vect_next = get_row(j + 1, smoother_next, extrapol, 0, 1); - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - - // Update (j, i) - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect_next[i]; - col = j * ntheta_int + i; - - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother_cur == smoother) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - row2 = row_vect[imoins(i, ntheta_int)]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[i]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[i]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - else { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j-1, i) - row = row_vect_prev[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = art_vect[i]; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = -art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - - // Update (j+1, i) - row = row_vect_next[i]; - val = -art_vect[i]; - val2 = art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - } - dep_Asc_ortho_cur[j] = 1; - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! First lines !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = start_j; - odd_j = j % 2; -#pragma omp task shared(u, Au) firstprivate(smoother, j, odd_j) \ - depend(in \ - : dep_Asc_prev[j - odd_j], dep_Asc_prev[j + odd_j], dep_Asc_ortho_cur[j + 1]) \ - depend(in \ - : dep_Asc_ortho_cur[j + 2]) depend(out \ - : dep_Asc_ortho_cur[j]) - { - int start_loop, shift_loop; - int row, col, col2; - int smoother_cur, smoother_next; - double coeff, coeff2, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - smoother_cur = j; - row_vect = get_row(j, smoother_cur, extrapol, 0, 1); - if (j < delete_circles - 1) { - smoother_next = (j + 1) % 2; - row_vect_next = get_row(j + 1, smoother_next, extrapol, 0, 1); - } - else if (j == delete_circles - 1) { - smoother_vect_next = get_smoother_radial(j + 1); - smoother_next = smoother_vect_next[0]; - row_vect_next = get_row(j + 1, 2, extrapol, 0, 1); - } - - hs = hplus[j]; - if (j > 0) { - hsmin1 = hplus[j - 1]; - } - else { - hsmin1 = 2 * r[0]; // across the origin - } - // Across and DB_int updates - gyro::arr_att_art(r[j], theta, sin_theta, cos_theta, ntheta_int, arr_vect, att_vect, art_vect, 0); - if (smoother_cur == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - row = row_vect[i]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - - Au[row] -= val * u[col]; - } - if (extrapol && smoother == 0) { - start_loop = 0; - shift_loop = 2; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i) - row = row_vect[iplus(i, ntheta_int)]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[i]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect[imoins(i, ntheta_int)]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - - // Update (j, i) - kt = thetaplus_per[i + 2]; - ktmin1 = thetaplus_per[i + 1]; - row = row_vect[i + 1]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[i + 1]; - col = j * ntheta_int + imoins(i + 1, ntheta_int); - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + iplus(i + 1, ntheta_int); - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - start_loop = 0; - if (extrapol && smoother == 0) - shift_loop = 2; - else - shift_loop = 1; - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - // Update (j, i+1) - row = row_vect[iplus(i, ntheta_int)]; - col = (j + 1) * ntheta_int + i; - val = art_vect[i]; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect[imoins(i, ntheta_int)]; - - Au[row] -= -val * u[col]; - } - } - } - - // Update (j+1, i) - if (j < delete_circles - 1 && smoother_next == smoother) { - if (extrapol && smoother == 0) { - start_loop = 1; - shift_loop = 2; - } - else { - start_loop = 0; - shift_loop = 1; - } - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - - row = row_vect_next[i]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[i] / hs; - - val = -coeff; - - Au[row] -= val * u[col]; - } - if (gyro::icntl[Param::mod_pk] > 0) - for (int i = start_loop; i < ntheta_int; i += shift_loop) { - row = row_vect_next[i]; - col = j * ntheta_int + imoins(i, ntheta_int); - val = -art_vect[i]; - col2 = j * ntheta_int + iplus(i, ntheta_int); - val2 = art_vect[i]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - dep_Asc_ortho_cur[j] = 1; - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! RADIAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - if (smoother > 1) { - int diff = ntheta_int % 3; - int odd_d = delete_circles % 2; - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! (0)) !!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - - for (int i = 0; i < diff; i++) { - { - int im = imoins(i, ntheta_int); - int ip = iplus(i, ntheta_int); - int im2 = imoins(im, ntheta_int); - int ip2 = iplus(ip, ntheta_int); - int odd_i = i % 2; - int ind_m_odd = i, ind_p_odd = i; - if (odd_i) { - ind_m_odd = im; - ind_p_odd = ip; - } -#pragma omp task shared(u, Au) firstprivate(smoother, im, i, ip, im2, ip2, odd_i, odd_d) \ - depend(in \ - : dep_Asc_prev[ind_m_odd]) depend(in \ - : dep_Asc_prev[ind_p_odd], dep_Asc1[delete_circles - 1 - odd_d]) \ - depend(in \ - : dep_Asc_ortho_cur[i - 1]) depend(out \ - : dep_Asc_ortho_cur[i]) - { - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, coeff3, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - int j; - int s_cur = (i % 2) + 2; - int s_next = ((i + 1) % 2) + 2; - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother_cur = s_cur; - smoother_prev = s_next; - smoother_next = s_next; - row_vect_prev = get_row_i_glob(nr, im, smoother_prev, extrapol); - row_vect = get_row_i_glob(nr, i, smoother_cur, extrapol); - row_vect_next = get_row_i_glob(nr, ip, smoother_next, extrapol); - gyro::arr_att_art(r, theta[i], arr_vect, att_vect, art_vect, 0); - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - if (gyro::icntl[Param::mod_pk] > 0) { - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - - j = delete_circles; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / kt; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / ktmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - - Au[row] -= val * u[col]; - } - else { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - row2 = row_vect_prev[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (j = delete_circles + 1; j < nr_int - 1; j++) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - // coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - else { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - row2 = row_vect[j + 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j+1, i) - Au[row2] -= -val; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= -val; - } - } - } - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - j = nr_int - 1; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff3 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff3 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 0) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - else { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= -val * u[col]; - } - } - } - } - dep_Asc_ortho_cur[i] = 1; - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! (1)) !!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int i = diff; i < ntheta_int; i += 3) { - { - int im = imoins(i, ntheta_int); - int ip = iplus(i, ntheta_int); - int im2 = imoins(im, ntheta_int); - int ip2 = iplus(ip, ntheta_int); - int odd_i = i % 2; - int ind_m_odd = i, ind_p_odd = i; - if (odd_i) { - ind_m_odd = im; - ind_p_odd = ip; - } -#pragma omp task shared(u, Au) firstprivate(smoother, im, i, ip, im2, ip2, odd_i) depend(in \ - : dep_Asc_prev[ind_m_odd]) \ - depend(in \ - : dep_Asc_prev[ind_p_odd], dep_Asc_ortho_cur[diff - 2], dep_Asc_ortho_cur[diff - 1]) \ - depend(out \ - : dep_Asc_ortho_cur[i]) - { - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, coeff3, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - int j; - int s_cur = (i % 2) + 2; - int s_next = ((i + 1) % 2) + 2; - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother_cur = s_cur; - smoother_prev = s_next; - smoother_next = s_next; - row_vect_prev = get_row_i_glob(nr, im, smoother_prev, extrapol); - row_vect = get_row_i_glob(nr, i, smoother_cur, extrapol); - row_vect_next = get_row_i_glob(nr, ip, smoother_next, extrapol); - gyro::arr_att_art(r, theta[i], arr_vect, att_vect, art_vect, 0); - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - if (gyro::icntl[Param::mod_pk] > 0) { - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - - j = delete_circles; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / kt; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / ktmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - - Au[row] -= val * u[col]; - } - else { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - row2 = row_vect_prev[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (j = delete_circles + 1; j < nr_int - 1; j++) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - // coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - else { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - row2 = row_vect[j + 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j+1, i) - Au[row2] -= -val; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= -val; - } - } - } - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - j = nr_int - 1; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff3 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff3 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 0) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - else { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= -val * u[col]; - } - } - } - } - dep_Asc_ortho_cur[i] = 1; - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! (2)) !!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int i = diff + 1; i < ntheta_int; i += 3) { - { - int im = imoins(i, ntheta_int); - int ip = iplus(i, ntheta_int); - int im2 = imoins(im, ntheta_int); - int ip2 = iplus(ip, ntheta_int); - int odd_i = i % 2; - int ind_m_odd = i, ind_p_odd = i; - if (odd_i) { - ind_m_odd = im; - ind_p_odd = ip; - } -#pragma omp task shared(u, Au) firstprivate(smoother, im, i, ip, im2, ip2, odd_i) depend(in \ - : dep_Asc_prev[ind_m_odd]) \ - depend(in \ - : dep_Asc_prev[ind_p_odd], dep_Asc_ortho_cur[im], dep_Asc_ortho_cur[ip2]) depend(out \ - : dep_Asc_ortho_cur[i]) - { - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, coeff3, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - int j; - int s_cur = (i % 2) + 2; - int s_next = ((i + 1) % 2) + 2; - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother_cur = s_cur; - smoother_prev = s_next; - smoother_next = s_next; - row_vect_prev = get_row_i_glob(nr, im, smoother_prev, extrapol); - row_vect = get_row_i_glob(nr, i, smoother_cur, extrapol); - row_vect_next = get_row_i_glob(nr, ip, smoother_next, extrapol); - gyro::arr_att_art(r, theta[i], arr_vect, att_vect, art_vect, 0); - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - if (gyro::icntl[Param::mod_pk] > 0) { - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - - j = delete_circles; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / kt; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / ktmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - - Au[row] -= val * u[col]; - } - else { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - row2 = row_vect_prev[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (j = delete_circles + 1; j < nr_int - 1; j++) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - // coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - else { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - row2 = row_vect[j + 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j+1, i) - Au[row2] -= -val; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= -val; - } - } - } - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - j = nr_int - 1; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff3 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff3 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 0) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - else { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= -val * u[col]; - } - } - } - } - dep_Asc_ortho_cur[i] = 1; - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! (3)) !!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (int i = diff + 2; i < ntheta_int; i += 3) { - { - int im = i - 1; - int ip = iplus(i, ntheta_int); - int im2 = imoins(im, ntheta_int); - int ip2 = iplus(ip, ntheta_int); - int odd_i = i % 2; - int ind_m_odd = i, ind_p_odd = i; - if (odd_i) { - ind_m_odd = im; - ind_p_odd = ip; - } -#pragma omp task shared(u, Au) firstprivate(smoother, im, i, ip, im2, ip2, odd_i) depend(in \ - : dep_Asc_prev[ind_m_odd]) \ - depend(in \ - : dep_Asc_prev[ind_p_odd], dep_Asc_ortho_cur[im], dep_Asc_ortho_cur[ip2]) depend(out \ - : dep_Asc_ortho_cur[i]) - { - int row, row2, col, col2; - int smoother_prev, smoother_cur, smoother_next; - double coeff, coeff2, coeff3, kt, ktmin1, hs, hsmin1, val, val2; - std::vector row_vect_prev, row_vect, row_vect_next; - std::vector smoother_vect_prev, smoother_vect, smoother_vect_next; - std::vector arr_vect, arr_vect2, att_vect, art_vect; - - int j; - int s_cur = (i % 2) + 2; - int s_next = ((i + 1) % 2) + 2; - kt = thetaplus_per[i + 1]; - ktmin1 = thetaplus_per[i]; - smoother_cur = s_cur; - smoother_prev = s_next; - smoother_next = s_next; - row_vect_prev = get_row_i_glob(nr, im, smoother_prev, extrapol); - row_vect = get_row_i_glob(nr, i, smoother_cur, extrapol); - row_vect_next = get_row_i_glob(nr, ip, smoother_next, extrapol); - gyro::arr_att_art(r, theta[i], arr_vect, att_vect, art_vect, 0); - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Circle-Radial (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - j = delete_circles - 1; - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - if (gyro::icntl[Param::mod_pk] > 0) { - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Link Radial-Circle (radial) !!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - - j = delete_circles; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / kt; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j] / ktmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - - Au[row] -= val * u[col]; - } - else { - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (!(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - row2 = row_vect_prev[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - Au[row2] -= -val; - } - } - if (!(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + im; - val = -art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - } - - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!! Interior nodes !!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - for (j = delete_circles + 1; j < nr_int - 1; j++) { - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j, i) - row = row_vect[j]; - // coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - coeff2 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff2 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff2 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 1) { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j + 1) * ntheta_int + i; - val = -coeff / hs; - col2 = (j - 1) * ntheta_int + i; - val2 = -coeff / hsmin1; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - else { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - - // Update (j+1, i) - row = row_vect[j + 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hs; - val = -coeff; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - row2 = row_vect[j + 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j+1, i) - Au[row2] -= -val; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= val; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - col2 = (j + 1) * ntheta_int + i; - val2 = art_vect[j]; - - val = val * u[col] + val2 * u[col2]; - Au[row] -= -val; - } - } - } - } - /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!! Last lines !!!!!!!!!!!!!!!!!!!!!!!! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - // DB_ext updates (~~~ Interior - (j+1, i) + DB) - j = nr_int - 1; - hs = hplus[j]; - hsmin1 = hplus[j - 1]; - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - row = row_vect[j]; - // Contribution to middle (top) from DB - coeff3 = 0.5 * (hs + hsmin1) * att_vect[j]; - col = j * ntheta_int + im; - val = -coeff3 / ktmin1; - col2 = j * ntheta_int + ip; - val2 = -coeff3 / kt; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - // Update (j, i+1) - row = row_vect_next[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / kt; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = j * ntheta_int + i; - coeff = 0.5 * (hs + hsmin1) * att_vect[j]; - val = -coeff / ktmin1; - - Au[row] -= val * u[col]; - } - } - if (extrapol && smoother == 2 && i % 2 == 0) { - if (j % 2 == 0) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + i; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j] / hsmin1; - val = -coeff; - - Au[row] -= val * u[col]; - } - else { - // Update (j, i) - row = row_vect[j]; - coeff = 0.5 * (kt + ktmin1) * arr_vect[j]; - col = (j - 1) * ntheta_int + i; - val = -coeff / hsmin1; - - Au[row] -= val * u[col]; - } - } - if (gyro::icntl[Param::mod_pk] > 0) { - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 1)) { - if ((smoother == 3 && i % 2 == 1) || (smoother == 2 && i % 2 == 0)) { - // Update (j-1, i) - row = row_vect[j - 1]; - col = j * ntheta_int + im; - val = art_vect[j]; - col2 = j * ntheta_int + ip; - val2 = -art_vect[j]; - - Au[row] -= val * u[col] + val2 * u[col2]; - } - } - if (smoother > 1 && !(extrapol && smoother == 2 && j % 2 == 0)) { - if ((smoother == 3 && i % 2 == 0) || (smoother == 2 && i % 2 == 1)) { - row = row_vect_next[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= val * u[col]; - - // Update (j, i-1) - row = row_vect_prev[j]; - col = (j - 1) * ntheta_int + i; - val = -art_vect[j]; - - Au[row] -= -val * u[col]; - } - } - } - } - dep_Asc_ortho_cur[i] = 1; - } - } - } -} /* ----- end of level::apply_Asc_ortho ----- */ diff --git a/src/smoother0.cpp b/src/smoother0.cpp deleted file mode 100644 index 7d86c6fb..00000000 --- a/src/smoother0.cpp +++ /dev/null @@ -1,1019 +0,0 @@ -/* -* Copyright (C) 2019-2023 The GMGPolar Development Team -* -* Authors: Philippe Leleux, Christina Schwarz, Martin J. Kühn, Carola Kruse, Ulrich Rüde -* -* Contact: -* Carola Kruse -* Martin J. Kuehn -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -/*! - * \file multigrid_iter.cpp - * \brief Implementation of the smoother (deprecated) - * \author M. Kuehn, C. Kruse, P. Leleux, C. Schwarz - * \version 0.0 - */ - -#include "level.h" - -/*! \brief Applies smoothing - * - * For all lines of the smoother s and the colour c. - * The matrix A_sc is for all lines of points of the smoother s/c. - * The result is in u (or u_previous_cu_previous_r). - * - * if gyro::icntl[Param::smoother]= - * - 3: block Gauss Seidel for all 4 smoothers. - * - 13: block Jacobi between Circle and Radial, and block Gauss Seidel for B/W inside each. - * - * \param smoother: the smoother -*/ -void level::multigrid_smoothing0(int smoother) -{ - //std::cout << "\n---------------- smoother: " << smoother << std::endl; - - double t, t_smoothing_tmp; - TIC; - t_smoothing_tmp = t; - - //! solving for u_sc (solution vector) - std::vector u_sc; - - //create f_sc - std::vector f_sc; - build_fsc0(f_sc, smoother); - - t_f_sc += TOC; - TIC; - - //compute f_total = f_sc - A_sc_ortho * u - //size of u_sc for the definition of size of A_sc_ortho = size of f_sc - std::vector f_total(m_sc[smoother], 0); - apply_Asc_ortho0(f_total, smoother); - - for (long unsigned int i = 0; i < f_total.size(); ++i) { - f_total[i] = f_sc[i] - f_total[i]; - } - - t_Asc_ortho += TOC; - TIC; - -#ifdef GMGPOLAR_USE_MUMPS - if (gyro::icntl[Param::optimized] == 0) { -#endif - u_sc = - solve_gaussian_elimination(A_Zebra_r_LU[smoother], A_Zebra_c_LU[smoother], A_Zebra_v_LU[smoother], f_total); -#ifdef GMGPOLAR_USE_MUMPS - } - else - u_sc = solve_mumps(mumps_A_Zebra[smoother], f_total); -#endif - - if (gyro::icntl[Param::verbose] > 5) - gyro::disp(u_sc, "u_sc"); - - t_Asc += TOC; - TIC; - - //------------------------------------------------------------------------------------------- - //! insert the solution vector u_sc into the whole vector u, depending on the smoother/colour - int extrapol = gyro::icntl[Param::extrapolation]; - //only for the circle black smoother, don't change the variable of the class itself - int ntheta_int_local = ntheta_int; - if (extrapol == 1 && l == 0 && smoother == 0) { //circle, black - ntheta_int_local = ntheta_int / 2; - } - int n_lines_radial_b = ceil((double)ntheta_int / 2); - int n_lines_radial_w = floor((double)ntheta_int / 2); - - //computation of indices in the total vector u corresponding to the indices in u_sc - for (long unsigned int i = 0; i < u_sc.size(); ++i) { - int row; - int col; - - if (smoother < 2) { //circle - row = i / ntheta_int_local; //row within the smoother - row = row * 2; //row within the whole matrix - col = i % ntheta_int_local; - if (smoother == 1) { //white - row++; - } - if (extrapol == 1 && l == 0 && smoother == 0) { //black - col = col * 2 + 1; //augment col in case of extrapolation - } - } - else { //radial - if (smoother == 2) { //black - row = i / n_lines_radial_b; //row within the smoother - col = i % n_lines_radial_b; //col within the smoother - col = col * 2; //col within the whole matrix - if (extrapol == 1 && l == 0) { - row = row * 2; //augment row in case of extrapolation - if (delete_circles % 2 == 0) { //delete_circles = even - row = row + 1; - } - } - } - else { //white - row = i / n_lines_radial_w; //row within the smoother - col = i % n_lines_radial_w; //col within the smoother - col = col * 2 + 1; //col within the whole matrix - } - row += delete_circles; //row within the whole matrix - } - - int index = row * ntheta_int + col; - - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - u_previous_c[index] = u_sc[i]; - } - else { //radial - u_previous_r[index] = u_sc[i]; - } - } - else { - u[index] = u_sc[i]; - } - } - - t_f_sc += TOC; - TIC; - - t = t_smoothing_tmp; - t_smoothing += TOC; - //std::cout << "smoothing end \n"; -} - -/*! \brief Create the RHS part corresponding to Asc_ortho for a smoother (on level l) - * - * Create f_sc, i.e. the RHS part corresponding to Asc_ortho for a smoother (on level l) - * - * \param f_sc: the RHS part (out) - * \param smoother: the smoother -*/ -void level::build_fsc0(std::vector& f_sc, int smoother) -{ - int n_indices_circle = delete_circles * ntheta_int; //delete_circles = index of radius of border between smoothers - int extrapol = gyro::icntl[Param::extrapolation]; - - if (smoother == 0) { //circle black smoother - if (extrapol == 1 && l == 0) { //extrapolation - //skip every second element - for (int ind = 1; ind < n_indices_circle; ind = ind + 2) { //iteration over all elements in the smoother - int r_index = ind / ntheta_int; //index in r-direction - //check if even r_index - if (!(r_index % 2)) { - f_sc.push_back(fVec[ind]); //insert elements of f corresponding to the colour - } - } - } - else { //no extrapolation - for (int ind = 0; ind < n_indices_circle; ++ind) { //iteration over all elements in the smoother - int r_index = ind / ntheta_int; //index in r-direction - //check if even r_index - if (!(r_index % 2)) { - f_sc.push_back(fVec[ind]); //insert elements of f corresponding to the colour - } - } - } - } - else if (smoother == 1) { //circle white smoother - for (int ind = 0; ind < n_indices_circle; ++ind) { //iteration over all elements in the smoother - int ind_local = ind; - int r_index = ind_local / ntheta_int; //index in r-direction - //check odd r_index - if (r_index % 2) { - f_sc.push_back(fVec[ind]); //insert elements of f corresponding to the colour - } - } - } - else if (smoother == 2) { //radial black smoother - //skip every second row - for (int ind = n_indices_circle; ind < m; ++ind) { //iteration over all elements in the smoother - int r_index = ind / ntheta_int; //index in r-direction - int theta_index = ind - r_index * ntheta_int; //index in theta-direction - - //check if black (even theta_index) or white (odd theta_index) - if (extrapol == 1 && l == 0) { //extrapolation - if (!(theta_index % 2) && r_index % 2) { //radial black, even theta_index, uneven row_index - f_sc.push_back(fVec[ind]); //insert elements of f corresponding to the colour - } - } - else { //no extrapolation - if (!(theta_index % 2)) { //radial black, even - f_sc.push_back(fVec[ind]); //insert elements of f corresponding to the colour - } - } - } - } - else { //radial white smoother - for (int ind = n_indices_circle; ind < m; ++ind) { //iteration over all elements in the smoother - int r_index = ind / ntheta_int; //index in r-direction - int theta_index = ind - r_index * ntheta_int; //index in theta-direction - if (theta_index % 2) { //radial white, odd - f_sc.push_back(fVec[ind]); //insert elements of f corresponding to the colour - } - } - } -} /* ----- end of level::build_subvectors ----- */ - -/*! \brief Build the matrix A_sc explicitely on the level l (deprecated) - * - * Asc corresponds to all lines of a smoother s with colour c - * so we need to build 4 matrices Asc for the 4 smoothers on the level l, all stored in A_Zebra - * 0,1: circular white/black - * 2,3: radial white/black - * - * this function is called only once at the beginning to build the matrices Asc on all levels - * the matrix should contain only the parts corresponding to (s/c), - * thus it is not of size m, but smaller (number of points corresponding to the smoother s/c), - * so we need to treat the indices (!) -*/ -void level::build_Asc0() -{ - //smoother=0 (circle), smoother=1 (radial), (0: white, 1: black) - - // if boundary is only defined on radius, checks for wrongly detected boundary - // nodes due to rounding errors (double checking...) - double tol_bound_check = 1e-8; - int smoother = 0; - int extrapol = gyro::icntl[Param::extrapolation]; - - A_Zebra_r.assign(4, std::vector()); - A_Zebra_c.assign(4, std::vector()); - A_Zebra_v.assign(4, std::vector()); - - int n_cols_radial = ntheta_int / 2; - int col; - // double x, y; - double val; - int extrapol_fine_node; //indicates if we have extrapolation on level 0 AND a fine node - // to count the fine nodes, to know the index without the coarse nodes - std::vector count_nodes = {0, 0, 0, 0}; //cb, cw, rb, rw - - //! Take boundary condition into account in the operator; inner circle is part of the circle smoother (black) - // gyro::trafo(r[0], theta[0], x, y, 0); - //check if r0 is on the boundary, if so, we have Diriclet BC - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { - // if (r[0] != gyro::dcntl[Param::r0_DB]) { - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - // } - // Dirichlet-RB (the inner circle, that is on the Diriclet boundary, just insert "ones" on the diagonal) - for (int i = 0; i < ntheta_int; i++) { - extrapol_fine_node = 0; - //only in case of extrapolation on level 0 - if (extrapol == 1 && l == 0) { - if (coarse_nodes_list_theta[i] == -1 || coarse_nodes_list_r[0] == -1) { - //if the index is -1 in both lists, we have a fine node, otherwise the node is coarse - extrapol_fine_node = 1; - } - else { - continue; //the node is coarse, so we can skip this index, continue with next i in for-loop - } - } - - //if we have no extrapolation - //or if we have extrapolation but are not on level 0 - //or if we have extrapolation on level 0, and the node is fine - - count_nodes[smoother]++; - int index = count_nodes[smoother] - 1; - - A_Zebra_r[smoother].push_back(index); //just take indices of first line (r0), (j=0) - A_Zebra_c[smoother].push_back(index); - - A_Zebra_v[smoother].push_back(1.0); - } - } - - //! check if we start at j=0 (across the origin) or j=1 (Diriclet boundary) - // gyro::trafo(r[0], theta[0], x, y, 0); - int start_j; - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { //check if r0 is on the boundary - // if (fabs(gyro::distBoundary(x, y, 0)) < tol_bound_check && r[0] != gyro::dcntl[Param::r0_DB]) - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - start_j = 1; //Diriclet - } - // dirBound([r(1),0])>0 means that (r(1),0) is not on Dirichlet boundary - else { - // if (fabs(gyro::distBoundary(x, y, 0)) > tol_bound_check && r[0] == gyro::dcntl[Param::r0_DB]) { - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - // } - start_j = 0; //across the origin - } - - // % -------------------------------------------------------------------------------------------------- % - //!Iteration over all points! - for (int j = start_j; j < nr_int; j++) { // start with second circle (j=1), as we already treated the origin(j=0) - for (int i = 0; i < ntheta_int; i++) { - //!extrapolation: check if we have a fine or a coarse node - extrapol_fine_node = 0; - if (extrapol == 1 && l == 0) { //only do this in case of extrapolation and level 0 - if (coarse_nodes_list_theta[i] == -1 || coarse_nodes_list_r[j] == -1) { - extrapol_fine_node = 1; //the node is fine - } - else { - continue; //the node is coarse, so we can skip this index, go on with next i in for-loop - } - } - - //!check, which smoother the point belongs to: 0 circle black, 1 circle white, 2 radial black, 3 radial white - if (j < delete_circles) { - if (j % 2 == 0) { - smoother = 0; //circle black (even) - } - else { - smoother = 1; //circle white (odd) - } - } - else { - if (i % 2 == 0) { - smoother = 2; //radial black (even) - //odd number of points in theta-direction, we have one additional black colom - if (ntheta_int % 2) { - n_cols_radial = ntheta_int / 2 + 1; - } - } - else { - smoother = 3; //radial white (odd) - } - } - - //!compute the index of the point in the grid depending on the smoother (the index in the matrix) - count_nodes[smoother]++; - int index = count_nodes[smoother] - 1; //index of the point (i,j) - - //!variables for the calculation of vals - double kt = thetaplus[i]; //k_j - double thetamin1; //the coordinate of theta to the left - double thetap1 = 0; - double ktmin1; //k_j-1 - double hs; //h_i - double hsmin1; //h_i-1 - - if (i > 0) { //normal case - thetamin1 = theta[i - 1]; - ktmin1 = thetaplus[i - 1]; - } - else { //i==0, on the left of the domain, take periodic BCs into acount - thetamin1 = theta[ntheta_int - 1]; // equal to 2*PI-ktmin1 - ktmin1 = thetaplus[ntheta_int - 1]; - } - hs = hplus[j]; - if (j > 0) { - hsmin1 = hplus[j - 1]; - } - else { - hsmin1 = 2 * r[0]; // across the origin - } - - // % -------------------------------------------------------------------------------------------------- % - // 9-Point Stencil (attention order: bottom, bottom left, left, top left, top, top right, right, bottom right, middle) - - //check if we have a black point --> fine black point has two coarse neighbours and thus we only treat the middle - //skip bottom/left/top/right if we have a fine black point - int fine_black_point = 0; - if (extrapol_fine_node == 1 && (smoother == 0 || smoother == 2)) { - fine_black_point = 1; - } - //! bottom (r - h-) (only radial smoother) (and circle smoother with across-the-origin) - // (as every fine point has two coarse nodes as neighbours, this entry is shifted to the rhs --> Asc_ortho) - if ((fine_black_point == 0 && smoother > 1 && j != delete_circles) || (smoother == 0 && j == 0)) { - //std::cout << ", bottom"; - //first row of radial smoother: link to the circle smoother --> A_sc_ortho - //across the origin (for j=0): link of points of inner circle --> A_sc - - // if (j == 1) { // j=1 means r-h is on the boundary, for Diriclet - // gyro::trafo(r[j - 1], theta[i], x, y, 0); - // } - if (j == 1 && fabs(gyro::distBoundary(r[j - 1], theta[i], 0)) < tol_bound_check) { - //empty - //for r1: r0 is on the boundary (for Diriclet BC) - //we don't treat the bottom point for r1 as it is connected to the boundary (r0) and we thus bring it to the rhs - } - else { - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) - if (j > 0) { - // to u at r-h geometrically recorded (i.e. -ntheta_int nodes at slice sorting) - col = index - n_cols_radial; - } - else { //j=0: across the origin - int shift; - if (extrapol == 1 && l == 0) - shift = n_cols_radial / 2; - else - shift = ntheta_int / 2; - if (i + 1 > ntheta_int / 2) { - col = index - shift; // half a turn back - } - else { - col = index + shift; // half a turn further - } - } - if (j > 0) { - - val = -0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)); - } - else { // j==0; across the origin, just use r_{s-1}=0 - - val = -0.5 * (kt + ktmin1) / hsmin1 * - (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j], theta[i] + PI, 0)); - } - - if (val != 0) { - A_Zebra_v[smoother].push_back(val); - A_Zebra_r[smoother].push_back(index); - A_Zebra_c[smoother].push_back(col); - } - } - } - if (fine_black_point == 0) { //Extrapolation: skip, if we have a fine point (only for the black smoother) - //! left (phi-k) (only circle smoother) - if (smoother < 2) { - //std::cout << ", left"; - val = -0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) - - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - - if (val != 0) { - A_Zebra_v[smoother].push_back(val); - A_Zebra_r[smoother].push_back(index); - - if (i > 0) { // previous node in phi direction - col = index - 1; - } - else { // periodicity condition - col = index + ntheta_int - 1; - } - A_Zebra_c[smoother].push_back(col); - } - } - - //! top (r + h+) (only radial smoother) - if (smoother > 1) { - //std::cout << ", top"; - // gyro::trafo(r[j + 1], theta[i], x, y, 0); - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1) { - // means that r[j+1] is not on the upper Dirichlet boundary - val = -0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) - - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)); - - if (val != 0) { - A_Zebra_v[smoother].push_back(val); - A_Zebra_r[smoother].push_back(index); - col = index + n_cols_radial; - A_Zebra_c[smoother].push_back(col); - } - } - } - - //! right (phi+k) (only circle smoother) - if (smoother < 2) { - //std::cout << ", right"; - if (i + 1 < ntheta_int) { // next node in theta direction - thetap1 = theta[i + 1]; - } - else { // periodicity condition - thetap1 = 2 * PI; - } - val = -0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) - - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)); - - if (val != 0) { - A_Zebra_v[smoother].push_back(val); - A_Zebra_r[smoother].push_back(index); - - if (i + 1 < ntheta_int) { // next node in theta direction - col = index + 1; - } - else { // periodicity condition - col = index - ntheta_int + 1; - } - A_Zebra_c[smoother].push_back(col); - } - } - } //treat middle also in the case of a fine black point - - //! middle (r,phi) (both smoothers) - //std::cout << ", middle" << std::endl; - if (i + 1 < ntheta_int) { // Define theta(i+1), this might be on the periodicity condition. - thetap1 = theta[i + 1]; - } - else { - thetap1 = 2 * PI; - } - - col = index; - if (j > 0) { - - val = 0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - } - else { //across the origin; j=0 - - val = 0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) + - 0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) + - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) + - 0.5 * kt / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)) + - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j], theta[i] + PI, 0) + gyro::arr(r[j], theta[i], 0)); - } - - val += betaVec[j * ntheta_int + i]; - - if (val != 0) { - A_Zebra_v[smoother].push_back(val); - A_Zebra_r[smoother].push_back(index); - A_Zebra_c[smoother].push_back(index); - } - } - } - - // % -------------------------------------------------------------------------------------------------- % - - //!treat the outer circle, which is on the Diriclet boundary (radial smoother) - double tmp = 0; - // gyro::trafo(r[nr_int], tmp, x, y, 0); - if (fabs(gyro::distBoundary(r[nr_int], tmp, 0)) < tol_bound_check) { //check if R_max is on boundary - // if (r[nr_int] != Rmax) { - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - // } - - for (int i = 0; i < ntheta_int; i++) { // iterate over all points of that circle - //check if the point is black or white - if (i % 2 == 0) { - smoother = 2; - } - else { - smoother = 3; - } - - //check if the node is coarse or fine - extrapol_fine_node = 0; - //only in case of extrapolation and level 0 - if (extrapol == 1 && l == 0) { - if (coarse_nodes_list_theta[i] == -1 || coarse_nodes_list_r[nr_int] == -1) { - extrapol_fine_node = 1; //the node is fine - } - else { - continue; //skip the index if the node is coarse - } - } - /*else { - int row = nr - delete_circles - 1; //last row = r_max-delete circles (-1 because indexing starts at zero) - int col = i / 2; - index = row * n_cols_radial + col; - }*/ - - count_nodes[smoother]++; - int index = count_nodes[smoother] - 1; - - A_Zebra_r[smoother].push_back(index); - A_Zebra_c[smoother].push_back(index); - A_Zebra_v[smoother].push_back(1.0); //just insert "ones" on the diagonal - } - } -} /* ----- end of level::build_Asc0 ----- */ - -/*! \brief Applies the matrix A_sc_ortho for a smoother explicitely on the level l (deprecated) - * - * Asc_ortho corresponds to all lines of a smoother s with colour c and the columns not in Asc - * - * \param smoother_todo: the smoother of this Asc_ortho matrix -*/ -void level::apply_Asc_ortho0(std::vector& Au, int smoother) -{ - //smoother: 0 (circle black), 1 (circle white), 2 (radial black), 3(radial white) - - // if boundary is only defined on radius, checks for wrongly detected boundary - // nodes due to rounding errors (double checking...) - double tol_bound_check = 1e-8; - int extrapol = gyro::icntl[Param::extrapolation]; - - // double x, y; - int col; - double val; - int n_cols_radial = ntheta_int / 2; - - int extrapol_fine_node; //indicates if we have extrapolation on level 0 AND a fine node - // to count the fine nodes, to know the index without the coarse nodes - std::vector count_nodes = {0, 0, 0, 0}; //cb, cw, rb, rw - - //! check if we start at j=0 (across the origin) or j=1 (Diriclet boundary) - // gyro::trafo(r[0], theta[0], x, y, 0); - // alt: r0=0/neumBound - int start_j; - // dirBound([r(1),0])==0 means that (r(1),0) is on Dirichlet boundary - if (fabs(gyro::distBoundary(r[0], theta[0], 0)) < tol_bound_check) { //check if r0 is on boundary - // if (fabs(gyro::distBoundary(x, y, 0)) < tol_bound_check && r[0] != gyro::dcntl[Param::r0_DB]) { - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - // } - start_j = 1; - if (extrapol == 1 && l == 0) - count_nodes[0] = n_cols_radial; //in case of the circle/black smoother, we start at the next line - else - count_nodes[0] = ntheta_int; - } - // dirBound([r(1),0])>0 means that (r(1),0) is not on Dirichlet boundary - else { - // if (fabs(gyro::distBoundary(x, y, 0)) > tol_bound_check && r[0] == gyro::dcntl[Param::r0_DB]) { - // throw std::runtime_error("Node on the boundary erroneously detected as node with boundary conditions " - // "(although there are none...)"); - // } - start_j = 0; - } - - // % -------------------------------------------------------------------------------------------------- % - //!Iteration over all points! - for (int j = start_j; j < nr_int; j++) { // start with second circle (j=1), as we already treated the origin(j=0) - for (int i = 0; i < ntheta_int; i++) { - //! if the index and the smoother don't fit together, just skip this point! - if ((j < delete_circles && ((j % 2 == 0 && smoother != 0) || (j % 2 != 0 && smoother != 1))) || - (j >= delete_circles && ((i % 2 == 0 && smoother != 2) || (i % 2 != 0 && smoother != 3)))) { - continue; - } - - //!index of the point in the overall total mxm matrix - //to indicate the col-index of the matrix A_sc_ortho of size (m_sc x m) - int base_row_index = j * ntheta_int + i; - - //!extrapolation: check if we have a fine or a coarse node - extrapol_fine_node = 0; - if (extrapol == 1 && l == 0) { //only do this in case of extrapolation and level 0 - if (coarse_nodes_list_theta[i] == -1 || coarse_nodes_list_r[j] == -1) { - extrapol_fine_node = 1; //the node is fine - } - else { - continue; //skip the index, if the node is coarse - } - } - - //!compute the index of the point in the grid depending on the smoother, and thus the row_index - count_nodes[smoother]++; - int row_index = count_nodes[smoother] - 1; //index of the point (i,j) - - double kt = thetaplus[i]; //k_j - double thetamin1; //the coordinate of theta to the left - double thetap1 = 0; //the coordinate of theta to the right - double ktmin1; //k_j-1 - double hs; //h_i - double hsmin1; //h_i-1 - - if (i > 0) { //normal case - thetamin1 = theta[i - 1]; - ktmin1 = thetaplus[i - 1]; - } - else { //i==0, on the left of the domain, take periodic BCs into acount - thetamin1 = theta[ntheta_int - 1]; // equal to 2*PI-ktmin1 - ktmin1 = thetaplus[ntheta_int - 1]; - } - hs = hplus[j]; - if (j > 0) { - hsmin1 = hplus[j - 1]; - } - else { - hsmin1 = 2 * r[0]; // across the origin - } - - // % -------------------------------------------------------------------------------------------------- % - // 9-Point Stencil (attention order: bottom, bottom left, left, top left, top, top right, right, bottom right, middle) - - //check if we have a black point - // --> fine black point has two coarse neighbours, thus we additionally need to treat the bottom/top or left/right - // - int fine_black_circle = 0; - int fine_black_radial = 0; - if (extrapol_fine_node == 1) { - if (smoother == 0) { - //the point belongs to the black/circle smoother --> additionally treat left/right - fine_black_circle = 1; - } - else if (smoother == 2) { - //the point belongs to the black/radial smoother --> additionally treat bottom/top - fine_black_radial = 1; - } - } - - //! bottom (r - h-) (only circle smoother) - //Extrapolation: also for radial smoother in case of a fine black node - if ((smoother < 2 && j < delete_circles && j > 0) || (smoother > 1 && j == delete_circles) || - fine_black_radial == 1 || (fine_black_circle == 1 && j > 0)) { - //for the circle smoother (but not the inner circle) - //and for the radial smoother for the first line, which has a bottom link to the circle smoother - - // if (j == 1) { - // gyro::trafo(r[j - 1], theta[i], x, y, 0); - // } - // j=1 means r-h is on the boundary - if (j == 1 && fabs(gyro::distBoundary(r[j - 1], theta[i], 0)) < tol_bound_check) { - //empty - //for r1: r0 is on the boundary for Diriclet BC - //we don't treat the bottom point for r1 as it is connected to the boundary (r0) and we thus bring it to the rhs - } - else { - // second circle (at least one 'real' circle with ntheta_int nodes which is closer to the origin) - col = base_row_index - ntheta_int; - val = -0.5 * kt / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)) - - 0.5 * ktmin1 / hsmin1 * (gyro::arr(r[j - 1], theta[i], 0) + gyro::arr(r[j], theta[i], 0)); - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - } - - //! bottom left (r-h-,phi-k) (for both smoothers) - if (j > 0) { //not for j=0 - // if (j == 1) { // coords necessary for potential boundary conditions - // gyro::trafo(r[j - 1], thetamin1, x, y, 0); // r(j) is PREVIOUS r, actual is r(J+1) ! - // } - // j=1 means r-h is on the boundary - if (j == 1 && fabs(gyro::distBoundary(r[j - 1], thetamin1, 0)) < tol_bound_check) { - //empty - //no treatment of bottom point for r1 in the case of Diriclet - } - else { - if (i > 0) { // next node in theta direction but one circle before - col = base_row_index - ntheta_int - 1; - } - else { // periodicity condition - col = base_row_index - 1; - } - val = -(gyro::art(r[j], thetamin1, 0) + gyro::art(r[j - 1], theta[i], 0)); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - } - - //! left (phi-k) (radial smoother only) - //Extrapolation: also for circle smoother in case of a fine node - if ((smoother > 1 && j >= delete_circles) || fine_black_circle == 1) { - if (i > 0) { // previous node in phi direction - col = base_row_index - 1; - } - else { // periodicity condition - col = base_row_index + ntheta_int - 1; - } - val = -0.5 * hsmin1 / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)) - - 0.5 * hs / ktmin1 * (gyro::att(r[j], thetamin1, 0) + gyro::att(r[j], theta[i], 0)); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - - //! top left (r+h+,phi-k) (for both smoothers) - double theta_eval_prelast = 0; - if (i > 0) { // not the first node on the corresponding circle; we can take theta(i-1) - // gyro::trafo(r[j + 1], theta[i - 1], x, y, 0); - } - else { - theta_eval_prelast = theta[ntheta_int - 1]; - // gyro::trafo(r[j + 1], theta_eval_prelast, x, y, 0); - } - - if (j < nr_int - 1) { - if (i > 0) { // previous node in phi direction but at r+h - col = base_row_index + ntheta_int - 1; - } - else { // first node on corresponding circle; pay gyro::attention to periodicity condition! - col = base_row_index + 2 * ntheta_int - 1; - } - val = gyro::art(r[j], thetamin1, 0) + gyro::art(r[j + 1], theta[i], 0); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - - //! top (r + h+) (circle smoother only) - //Extrapolation: also for radial smoother in case of a fine black node - if ((smoother < 2 && j < delete_circles) || fine_black_circle == 1 || fine_black_radial == 1) { - // gyro::trafo(r[j + 1], theta[i], x, y, 0); - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1) { - col = base_row_index + ntheta_int; - val = -0.5 * kt / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)) - - 0.5 * ktmin1 / hs * (gyro::arr(r[j], theta[i], 0) + gyro::arr(r[j + 1], theta[i], 0)); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - } - - //! top right (r+h+,phi+k) (for both smoothers) - if (i + 1 < ntheta_int) { // previous node in phi direction but at r+h - thetap1 = theta[i + 1]; - } - else { // first node on corresponding circle; pay gyro::attention to periodicity condition! - thetap1 = 2 * PI; - } - - // gyro::trafo(r[j + 1], thetap1, x, y, 0); - // means that r[j+1] is not on the Dirichlet boundary - if (j < nr_int - 1) { - if (i + 1 < ntheta_int) { // previous node in phi direction but at r+h - col = base_row_index + ntheta_int + 1; - } - else { // first node on corresponding circle; pay gyro::attention to periodicity condition! - col = base_row_index + 1; - } - val = -gyro::art(r[j + 1], theta[i], 0) - gyro::art(r[j], thetap1, 0); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - - //! right (phi+k) (radial smoother only) - //Extrapolation: also for circle smoother in case of a fine black node - if ((smoother > 1 && j >= delete_circles) || fine_black_circle == 1) { - if (i + 1 < ntheta_int) { // next node in theta direction - col = base_row_index + 1; - thetap1 = theta[i + 1]; - } - else { // periodicity condition - col = base_row_index - ntheta_int + 1; - thetap1 = 2 * PI; - } - val = -0.5 * hs / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)) - - 0.5 * hsmin1 / kt * (gyro::att(r[j], theta[i], 0) + gyro::att(r[j], thetap1, 0)); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - - //! bottom right (r-h-,phi+k) (for both smoothers) - if (j > 0) { //not for j=0 - double r_tmp, theta_tmp; - if (j == 1) { // coords necessary for potential boundary conditions - if (i + 1 < ntheta_int) { - // gyro::trafo(r[j - 1], theta[i + 1], x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = theta[i + 1]; - } - else { - double pi2 = 2 * PI; - // gyro::trafo(r[j - 1], pi2, x, y, 0); - r_tmp = r[j - 1]; - theta_tmp = pi2; - } - } - if (i + 1 < ntheta_int) { - thetap1 = theta[i + 1]; - } - else { - thetap1 = 2 * PI; - } - - if (j == 1 && fabs(gyro::distBoundary(r_tmp, theta_tmp, 0)) < tol_bound_check) { - //empty - //no treatment of bottom point for r1 in the case of Diriclet - } - else { - if (i + 1 < ntheta_int) { // next node in theta direction but one circle before - col = base_row_index - ntheta_int + 1; - } - else { // periodicity condition - col = base_row_index - 2 * ntheta_int + 1; - } - val = gyro::art(r[j - 1], theta[i], 0) + gyro::art(r[j], thetap1, 0); - - if (val != 0) { - if (gyro::icntl[Param::smoother] == 13) { - if (smoother < 2) { //circle - - Au[row_index] += val * u_previous_c[col]; - } - else { //radial - - Au[row_index] += val * u_previous_r[col]; - } - } - else { - - Au[row_index] += val * u[col]; - } - } - } - } - } - } -} /* ----- end of level::apply_Asc_ortho0 ----- */ diff --git a/src/strong_scaling.cpp b/src/strong_scaling.cpp new file mode 100644 index 00000000..35c59e8d --- /dev/null +++ b/src/strong_scaling.cpp @@ -0,0 +1,192 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "../include/GMGPolar/gmgpolar.h" +#include "../include/GMGPolar/test_cases.h" + +void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) +{ + const double R0 = 1e-8; + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; + + /* Example 1: Polar Solution -> Higher Order 4.0 */ + // const double alpha_jump = 0.4837 * Rmax; + // std::unique_ptr domain_geometry = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr exact_solution = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + // std::unique_ptr boundary_conditions = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr source_term = std::make_unique(Rmax, elongation_kappa, shift_delta); + + /* Example 2: Cartesian Solution -> Lower Order 3.5 */ + const double alpha_jump = 0.66 * Rmax; + std::unique_ptr domain_geometry = + std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + std::unique_ptr exact_solution = + std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + std::unique_ptr source_term = std::make_unique( + Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + + /* Example 3: Refined Solution -> Lower Order 3.5 */ + // const double alpha_jump = 0.9 * Rmax; // Refinement where the solution is most complex + // std::unique_ptr domain_geometry = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr exact_solution = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + // std::unique_ptr boundary_conditions = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr source_term = std::make_unique(Rmax, elongation_kappa, shift_delta); + + std::string geometry_string = ""; + if (typeid(*domain_geometry) == typeid(CircularGeometry)) { + geometry_string = "Circular"; + } + else if (typeid(*domain_geometry) == typeid(ShafranovGeometry)) { + geometry_string = "Shafranov"; + } + else if (typeid(*domain_geometry) == typeid(CzarnyGeometry)) { + geometry_string = "Czarny"; + } + else if (typeid(*domain_geometry) == typeid(CulhamGeometry)) { + geometry_string = "Culham"; + } + else { + geometry_string = "Unknown"; + } + + GMGPolar solver(std::move(domain_geometry), std::move(coefficients), std::move(boundary_conditions), + std::move(source_term)); + + solver.setSolution(std::move(exact_solution)); + + const int verbose = 1; + const bool paraview = false; + + const double threadReductionFactor = 1.0; + + const StencilDistributionMethod stencilDistributionMethod = StencilDistributionMethod::CPU_GIVE; + const bool cacheDensityProfileCoefficients = true; + const bool cacheDomainGeometry = false; + + const int nr_exp = 4; + const int ntheta_exp = 6; + const int anisotropic_factor = 3; + + const bool DirBC_Interior = false; + + const bool FMG = true; + const int FMG_iterations = 3; + const MultigridCycleType FMG_cycle = MultigridCycleType::F_CYCLE; + + const ExtrapolationType extrapolation = ExtrapolationType::NONE; + const int maxLevels = 7; + const int preSmoothingSteps = 1; + const int postSmoothingSteps = 1; + const MultigridCycleType multigridCycle = MultigridCycleType::F_CYCLE; + + const int maxIterations = 10; + const ResidualNormType residualNormType = ResidualNormType::EUCLIDEAN; + const double absoluteTolerance = 1e-50; + const double relativeTolerance = 1e-50; + + solver.verbose(verbose); + solver.paraview(paraview); + + solver.maxOpenMPThreads(maxOpenMPThreads); + solver.threadReductionFactor(threadReductionFactor); + + solver.stencilDistributionMethod(stencilDistributionMethod); + solver.cacheDensityProfileCoefficients(cacheDensityProfileCoefficients); + solver.cacheDomainGeometry(cacheDomainGeometry); + + solver.R0(R0); + solver.Rmax(Rmax); + solver.nr_exp(nr_exp); + solver.ntheta_exp(ntheta_exp); + solver.anisotropic_factor(anisotropic_factor); + solver.divideBy2(divideBy2); + + solver.DirBC_Interior(DirBC_Interior); + + solver.FMG(FMG); + solver.FMG_iterations(FMG_iterations); + solver.FMG_cycle(FMG_cycle); + + solver.extrapolation(extrapolation); + solver.maxLevels(maxLevels); + solver.preSmoothingSteps(preSmoothingSteps); + solver.postSmoothingSteps(postSmoothingSteps); + solver.multigridCycle(multigridCycle); + + solver.maxIterations(maxIterations); + solver.residualNormType(residualNormType); + solver.absoluteTolerance(absoluteTolerance); + solver.relativeTolerance(relativeTolerance); + + // Perform setup and solve + solver.setup(); + solver.solve(); + + std::string stencil_string = ""; + if (solver.stencilDistributionMethod() == StencilDistributionMethod::CPU_TAKE) { + stencil_string = "Take"; + } + else if (solver.stencilDistributionMethod() == StencilDistributionMethod::CPU_GIVE) { + stencil_string = "Give"; + } + + int extrapolation_int = static_cast(solver.extrapolation()); + + // Write results to file + outfile << maxOpenMPThreads << "," << divideBy2 << "," << solver.grid().nr() << "," << solver.grid().ntheta() << "," + << geometry_string << "," << stencil_string << "," << cacheDensityProfileCoefficients << "," + << cacheDomainGeometry << "," << FMG << "," << extrapolation_int << "," + << solver.t_setup_total + solver.t_solve_total - solver.t_setup_rhs << "," + << solver.t_setup_total - solver.t_setup_rhs << "," << solver.t_setup_createLevels << "," + << solver.t_setup_smoother << "," << solver.t_setup_directSolver << "," << solver.t_solve_total << "," + << solver.t_solve_initial_approximation << "," << solver.t_solve_multigrid_iterations << "," + << solver.t_check_convergence << "," << solver.t_check_exact_error << "," << solver.t_avg_MGC_total << "," + << solver.t_avg_MGC_preSmoothing << "," << solver.t_avg_MGC_postSmoothing << "," + << solver.t_avg_MGC_residual << "," << solver.t_avg_MGC_directSolver << std::endl; +} + +int main() +{ + std::ofstream outfile("strong_scaling_results.csv"); + outfile << "Threads,DivideBy2,nr,ntheta,geometry," + << "stencil_method,cacheDensityProfileCoefficients,cacheDomainGeometry,FMG,extrapolation_int," + << "TotalTime,t_setup_total,t_setup_createLevels," + << "t_setup_smoother,t_setup_directSolver,t_solve_total,t_solve_initial_approximation," + << "t_solve_multigrid_iterations,t_check_convergence,t_check_exact_error," + << "t_avg_MGC_total,t_avg_MGC_preSmoothing,t_avg_MGC_postSmoothing," + << "t_avg_MGC_residual,t_avg_MGC_directSolver\n"; // Header + + // Define the constant parameters for the problem size + int divideBy2 = 7; // Keeping the domain division constant + + // Vary only the number of threads for strong scaling + // std::vector threadCounts = {1, 2, 4, 8, 16, 32}; // Thread counts to test strong scaling + + int n = 56; + std::vector threadCounts(n); + std::iota(threadCounts.begin(), threadCounts.end(), 1); + + for (size_t i = 0; i < threadCounts.size(); i++) { + runTest(threadCounts[i], divideBy2, outfile); // Keep problem size fixed, vary threads + } + + outfile.close(); + std::cout << "Results written to strong_scaling_results.csv" << std::endl; + + return 0; +} diff --git a/src/test_cases/CartesianR2GyroSonnendruckerCircular.cpp b/src/test_cases/CartesianR2GyroSonnendruckerCircular.cpp deleted file mode 100644 index 7ce4cb41..00000000 --- a/src/test_cases/CartesianR2GyroSonnendruckerCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroSonnendruckerCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-8.0) * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta))) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - ((r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-8.0) * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) - 5.03290747193186 * (r[i]/Rmax) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) / (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-8.0) * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i])) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroSonnendruckerShafranov.cpp b/src/test_cases/CartesianR2GyroSonnendruckerShafranov.cpp deleted file mode 100644 index b940c3c7..00000000 --- a/src/test_cases/CartesianR2GyroSonnendruckerShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroSonnendruckerShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - (2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - (2.0 * map1_delta * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r[i]/Rmax) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - (2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroSonnendruckerTriangular.cpp b/src/test_cases/CartesianR2GyroSonnendruckerTriangular.cpp deleted file mode 100644 index 3e744518..00000000 --- a/src/test_cases/CartesianR2GyroSonnendruckerTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroSonnendruckerTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - ((-(r[i]/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double CartesianR2GyroSonnendruckerTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2GyroSonnendruckerTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroZoniCircular.cpp b/src/test_cases/CartesianR2GyroZoniCircular.cpp deleted file mode 100644 index 2c7582f6..00000000 --- a/src/test_cases/CartesianR2GyroZoniCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroZoniCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroZoniCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - ((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0))) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - ((r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (r[i]/Rmax) * ((-8.0) * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - ((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroZoniCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroZoniShafranov.cpp b/src/test_cases/CartesianR2GyroZoniShafranov.cpp deleted file mode 100644 index b0584f4c..00000000 --- a/src/test_cases/CartesianR2GyroZoniShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroZoniShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroZoniShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))) - (2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroZoniShiftedCircular.cpp b/src/test_cases/CartesianR2GyroZoniShiftedCircular.cpp deleted file mode 100644 index 92a37a45..00000000 --- a/src/test_cases/CartesianR2GyroZoniShiftedCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - ((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0))) / (r/Rmax); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - ((r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * ((-8.0) * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - ((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroZoniShiftedShafranov.cpp b/src/test_cases/CartesianR2GyroZoniShiftedShafranov.cpp deleted file mode 100644 index 8d992420..00000000 --- a/src/test_cases/CartesianR2GyroZoniShiftedShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))) - (2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroZoniShiftedTriangular.cpp b/src/test_cases/CartesianR2GyroZoniShiftedTriangular.cpp deleted file mode 100644 index b37c88e1..00000000 --- a/src/test_cases/CartesianR2GyroZoniShiftedTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2GyroZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2GyroZoniTriangular.cpp b/src/test_cases/CartesianR2GyroZoniTriangular.cpp deleted file mode 100644 index 82d636d9..00000000 --- a/src/test_cases/CartesianR2GyroZoniTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2GyroZoniTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2GyroZoniTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2GyroZoniTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2GyroZoniTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2PoissonCircular.cpp b/src/test_cases/CartesianR2PoissonCircular.cpp deleted file mode 100644 index ecd7a2fb..00000000 --- a/src/test_cases/CartesianR2PoissonCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "CartesianR2PoissonCircular.h" -#include -#include -#include - - -/*........................................*/ -double CartesianR2PoissonCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2PoissonCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2PoissonCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2PoissonCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2PoissonCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2PoissonCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2PoissonCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-INT64_C(1)))); -} -/*........................................*/ -void CartesianR2PoissonCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-INT64_C(1)))); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-INT64_C(1)))); - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2PoissonCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2PoissonCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2PoissonCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2PoissonCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2PoissonCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 8.0 * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 4.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2PoissonCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 8.0 * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 4.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 8.0 * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 4.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2PoissonCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2PoissonCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2PoissonCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void CartesianR2PoissonCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2PoissonCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2PoissonCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2PoissonCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2PoissonCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2PoissonShafranov.cpp b/src/test_cases/CartesianR2PoissonShafranov.cpp deleted file mode 100644 index 80c9fa0a..00000000 --- a/src/test_cases/CartesianR2PoissonShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2PoissonShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2PoissonShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2PoissonShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2PoissonShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2PoissonShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 1.0 * (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2PoissonShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void CartesianR2PoissonShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2PoissonShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2PoissonShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2PoissonShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2PoissonShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2PoissonTriangular.cpp b/src/test_cases/CartesianR2PoissonTriangular.cpp deleted file mode 100644 index 5adfba5c..00000000 --- a/src/test_cases/CartesianR2PoissonTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2PoissonTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2PoissonTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2PoissonTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2PoissonTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-1.0) * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2PoissonTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-1.0) * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (r[i]/Rmax) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-1.0) * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 1.0 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 1.0 * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 1.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2PoissonTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void CartesianR2PoissonTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2PoissonTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2PoissonTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2PoissonTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2PoissonTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2SonnendruckerCircular.cpp b/src/test_cases/CartesianR2SonnendruckerCircular.cpp deleted file mode 100644 index 050e2693..00000000 --- a/src/test_cases/CartesianR2SonnendruckerCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2SonnendruckerCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR2SonnendruckerCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-8.0) * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-8.0) * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) - 5.03290747193186 * (r[i]/Rmax) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) / (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-8.0) * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2SonnendruckerCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2SonnendruckerShafranov.cpp b/src/test_cases/CartesianR2SonnendruckerShafranov.cpp deleted file mode 100644 index b48e116e..00000000 --- a/src/test_cases/CartesianR2SonnendruckerShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2SonnendruckerShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2SonnendruckerShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r[i]/Rmax) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2SonnendruckerShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2SonnendruckerShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2SonnendruckerTriangular.cpp b/src/test_cases/CartesianR2SonnendruckerTriangular.cpp deleted file mode 100644 index 718408b0..00000000 --- a/src/test_cases/CartesianR2SonnendruckerTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2SonnendruckerTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2SonnendruckerTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r[i]/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2SonnendruckerTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2SonnendruckerTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2ZoniCircular.cpp b/src/test_cases/CartesianR2ZoniCircular.cpp deleted file mode 100644 index f2b5a140..00000000 --- a/src/test_cases/CartesianR2ZoniCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2ZoniCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR2ZoniCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2ZoniCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2ZoniCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2ZoniCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2ZoniCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR2ZoniCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2ZoniCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2ZoniCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2ZoniCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2ZoniCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2ZoniCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR2ZoniCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (r[i]/Rmax) * ((-8.0) * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2ZoniCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2ZoniCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2ZoniCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2ZoniCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2ZoniCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2ZoniShafranov.cpp b/src/test_cases/CartesianR2ZoniShafranov.cpp deleted file mode 100644 index 83318b58..00000000 --- a/src/test_cases/CartesianR2ZoniShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2ZoniShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2ZoniShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2ZoniShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2ZoniShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2ZoniShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2ZoniShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2ZoniShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2ZoniShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2ZoniShiftedCircular.cpp b/src/test_cases/CartesianR2ZoniShiftedCircular.cpp deleted file mode 100644 index 7c7c31d9..00000000 --- a/src/test_cases/CartesianR2ZoniShiftedCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2ZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR2ZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * ((-8.0) * M_PI * (r[i]/Rmax) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 8.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 8.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-8.0) * M_PI * (r/Rmax) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 8.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 8.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2ZoniShiftedShafranov.cpp b/src/test_cases/CartesianR2ZoniShiftedShafranov.cpp deleted file mode 100644 index 6af2ef5d..00000000 --- a/src/test_cases/CartesianR2ZoniShiftedShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2ZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.0 * M_PI * (r[i]/Rmax) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - M_PI * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * (r[i]/Rmax) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * map1_kappa + 2.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (4.0 * M_PI * map1_delta * (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * (r/Rmax) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.0 * M_PI * (r/Rmax) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-4.0) * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.0 * M_PI * ((r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow((map1_kappa + 1.0), 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - M_PI * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa - 2.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * (r/Rmax) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * map1_kappa + 2.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2ZoniShiftedTriangular.cpp b/src/test_cases/CartesianR2ZoniShiftedTriangular.cpp deleted file mode 100644 index 21f2d195..00000000 --- a/src/test_cases/CartesianR2ZoniShiftedTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2ZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2ZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR2ZoniTriangular.cpp b/src/test_cases/CartesianR2ZoniTriangular.cpp deleted file mode 100644 index 710e5d6b..00000000 --- a/src/test_cases/CartesianR2ZoniTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR2ZoniTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR2ZoniTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR2ZoniTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR2ZoniTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR2ZoniTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * (r[i]/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * (r[i]/Rmax) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 4.0 * (r[i]/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 8.0 * M_PI * (r[i]/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 2.0 * ((r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 4.0 * M_PI * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + ((1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 4.0 * M_PI * (r[i]/Rmax) * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-2.0) * (r[i]/Rmax) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * M_PI * (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * (r/Rmax) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * (r/Rmax) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 4.0 * (r/Rmax) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 8.0 * M_PI * (r/Rmax) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (1.0 - (r/Rmax) * (r/Rmax)) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.0 * (M_PI * M_PI) * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 2.0 * ((r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 4.0 * M_PI * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + ((1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * M_PI * map2_epsilon * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 4.0 * (M_PI * M_PI) * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 4.0 * M_PI * (r/Rmax) * (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + (1.0 - (r/Rmax) * (r/Rmax)) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-2.0) * (r/Rmax) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + (1.0 - (r/Rmax) * (r/Rmax)) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * M_PI * (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR2ZoniTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR2ZoniTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR2ZoniTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR2ZoniTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r[i]/Rmax) * (r[i]/Rmax)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR2ZoniTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - (r/Rmax) * (r/Rmax)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroSonnendruckerCircular.cpp b/src/test_cases/CartesianR6GyroSonnendruckerCircular.cpp deleted file mode 100644 index 8d9eb3c7..00000000 --- a/src/test_cases/CartesianR6GyroSonnendruckerCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroSonnendruckerCircular.h" -#include -#include - -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) - 5.03290747193186 * (r/Rmax) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - ((r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) - 5.03290747193186 * (r[i]/Rmax) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) / (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) - 5.03290747193186 * (r/Rmax) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i])) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroSonnendruckerShafranov.cpp b/src/test_cases/CartesianR6GyroSonnendruckerShafranov.cpp deleted file mode 100644 index 99b56e8b..00000000 --- a/src/test_cases/CartesianR6GyroSonnendruckerShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroSonnendruckerShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - (2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - (2.0 * map1_delta * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - (2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroSonnendruckerTriangular.cpp b/src/test_cases/CartesianR6GyroSonnendruckerTriangular.cpp deleted file mode 100644 index e58741fc..00000000 --- a/src/test_cases/CartesianR6GyroSonnendruckerTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroSonnendruckerTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - ((-(r[i]/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - ((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double CartesianR6GyroSonnendruckerTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6GyroSonnendruckerTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroZoniCircular.cpp b/src/test_cases/CartesianR6GyroZoniCircular.cpp deleted file mode 100644 index 22a3610a..00000000 --- a/src/test_cases/CartesianR6GyroZoniCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroZoniCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroZoniCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - ((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - ((r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (r[i]/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - ((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroZoniCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroZoniShafranov.cpp b/src/test_cases/CartesianR6GyroZoniShafranov.cpp deleted file mode 100644 index 4fc457ef..00000000 --- a/src/test_cases/CartesianR6GyroZoniShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroZoniShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroZoniShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))) - (2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroZoniShiftedCircular.cpp b/src/test_cases/CartesianR6GyroZoniShiftedCircular.cpp deleted file mode 100644 index dd8f07e8..00000000 --- a/src/test_cases/CartesianR6GyroZoniShiftedCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - ((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - ((r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - ((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroZoniShiftedShafranov.cpp b/src/test_cases/CartesianR6GyroZoniShiftedShafranov.cpp deleted file mode 100644 index 9e9c4700..00000000 --- a/src/test_cases/CartesianR6GyroZoniShiftedShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))) - (2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])) - (2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroZoniShiftedTriangular.cpp b/src/test_cases/CartesianR6GyroZoniShiftedTriangular.cpp deleted file mode 100644 index e13c99cc..00000000 --- a/src/test_cases/CartesianR6GyroZoniShiftedTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6GyroZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6GyroZoniTriangular.cpp b/src/test_cases/CartesianR6GyroZoniTriangular.cpp deleted file mode 100644 index 760e29f6..00000000 --- a/src/test_cases/CartesianR6GyroZoniTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6GyroZoniTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6GyroZoniTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - ((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - ((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6GyroZoniTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6GyroZoniTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6PoissonCircular.cpp b/src/test_cases/CartesianR6PoissonCircular.cpp deleted file mode 100644 index 1b21e785..00000000 --- a/src/test_cases/CartesianR6PoissonCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "CartesianR6PoissonCircular.h" -#include -#include -#include - - -/*........................................*/ -double CartesianR6PoissonCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6PoissonCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6PoissonCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6PoissonCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6PoissonCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6PoissonCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6PoissonCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-INT64_C(1)))); -} -/*........................................*/ -void CartesianR6PoissonCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-INT64_C(1)))); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-INT64_C(1)))); - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6PoissonCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6PoissonCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6PoissonCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6PoissonCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6PoissonCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 1.0 * (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6PoissonCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 1.0 * (r[i]/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 1.0 * (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6PoissonCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6PoissonCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6PoissonCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void CartesianR6PoissonCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6PoissonCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6PoissonCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6PoissonCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6PoissonCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6PoissonShafranov.cpp b/src/test_cases/CartesianR6PoissonShafranov.cpp deleted file mode 100644 index ce8b8ac9..00000000 --- a/src/test_cases/CartesianR6PoissonShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR6PoissonShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6PoissonShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6PoissonShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6PoissonShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6PoissonShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 1.0 * (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 1.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6PoissonShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void CartesianR6PoissonShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6PoissonShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6PoissonShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6PoissonShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6PoissonShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6PoissonTriangular.cpp b/src/test_cases/CartesianR6PoissonTriangular.cpp deleted file mode 100644 index 76064240..00000000 --- a/src/test_cases/CartesianR6PoissonTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "CartesianR6PoissonTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6PoissonTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6PoissonTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6PoissonTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-1.0) * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6PoissonTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-1.0) * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (r[i]/Rmax) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 1.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-1.0) * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 1.0 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 1.0 * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 1.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6PoissonTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void CartesianR6PoissonTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6PoissonTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6PoissonTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6PoissonTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6PoissonTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6SonnendruckerCircular.cpp b/src/test_cases/CartesianR6SonnendruckerCircular.cpp deleted file mode 100644 index 290a990c..00000000 --- a/src/test_cases/CartesianR6SonnendruckerCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6SonnendruckerCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR6SonnendruckerCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) - 5.03290747193186 * (r/Rmax) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) - 5.03290747193186 * (r[i]/Rmax) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) / (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) - 5.03290747193186 * (r/Rmax) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6SonnendruckerCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6SonnendruckerShafranov.cpp b/src/test_cases/CartesianR6SonnendruckerShafranov.cpp deleted file mode 100644 index 63749cff..00000000 --- a/src/test_cases/CartesianR6SonnendruckerShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6SonnendruckerShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6SonnendruckerShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6SonnendruckerShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6SonnendruckerShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6SonnendruckerTriangular.cpp b/src/test_cases/CartesianR6SonnendruckerTriangular.cpp deleted file mode 100644 index 9312a869..00000000 --- a/src/test_cases/CartesianR6SonnendruckerTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6SonnendruckerTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6SonnendruckerTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r[i]/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r/Rmax)) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 5.03290747193186 * (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6SonnendruckerTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6SonnendruckerTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6ZoniCircular.cpp b/src/test_cases/CartesianR6ZoniCircular.cpp deleted file mode 100644 index f7721f45..00000000 --- a/src/test_cases/CartesianR6ZoniCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6ZoniCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR6ZoniCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6ZoniCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6ZoniCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6ZoniCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6ZoniCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR6ZoniCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6ZoniCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6ZoniCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6ZoniCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6ZoniCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6ZoniCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6ZoniCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (r[i]/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6ZoniCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6ZoniCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6ZoniCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6ZoniCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6ZoniCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6ZoniShafranov.cpp b/src/test_cases/CartesianR6ZoniShafranov.cpp deleted file mode 100644 index 03fbb0c2..00000000 --- a/src/test_cases/CartesianR6ZoniShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6ZoniShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6ZoniShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6ZoniShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6ZoniShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6ZoniShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6ZoniShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6ZoniShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6ZoniShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6ZoniShiftedCircular.cpp b/src/test_cases/CartesianR6ZoniShiftedCircular.cpp deleted file mode 100644 index 0ce60df7..00000000 --- a/src/test_cases/CartesianR6ZoniShiftedCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6ZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double CartesianR6ZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)))) / (r/Rmax); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 3.2768 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 3.2768 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * sin(2.0 * M_PI * (r[i]/Rmax) * cos(theta)) * cos(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)))) / (r[i]/Rmax); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((-1.6384) * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 3.2768 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 3.2768 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * sin(2.0 * M_PI * (r/Rmax) * cos_theta[i]) * cos_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)))) / (r/Rmax); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r/Rmax) * cos(theta)); -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r[i]/Rmax) * sin(theta)) * cos(2.0 * M_PI * (r[i]/Rmax) * cos(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (r/Rmax) * sin_theta[i]) * cos(2.0 * M_PI * (r/Rmax) * cos_theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6ZoniShiftedShafranov.cpp b/src/test_cases/CartesianR6ZoniShiftedShafranov.cpp deleted file mode 100644 index c225079d..00000000 --- a/src/test_cases/CartesianR6ZoniShiftedShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6ZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r[i]/Rmax) + M_PI * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (r[i]/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * pow(cos(theta), 2.0) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.8192 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-1.6384) * (M_PI * M_PI) * (r[i]/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(theta) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * (M_PI * M_PI) * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(theta) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * cos(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * cos(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) - 0.4096 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)) * sin(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta))) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (r[i]/Rmax) * (2.0 * map1_kappa + 2.0) * sin(theta)) * cos(M_PI * (r[i]/Rmax) * ((-2.0) * map1_delta * (r[i]/Rmax) - 2.0 * map1_kappa * cos(theta) + 2.0 * cos(theta)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(2.0 * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (1.6384 * M_PI * map1_delta * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 1.6384 * (M_PI * M_PI) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 4.9152 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map1_delta * (r/Rmax) + M_PI * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (r/Rmax) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * pow(cos_theta[i], 2.0) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * pow((2.0 * map1_kappa - 2.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.8192 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] - 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-0.4096) * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-1.6384) * (M_PI * M_PI) * (r/Rmax) * pow((map1_kappa + 1.0), 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin_theta[i] * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * (M_PI * M_PI) * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos_theta[i] * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * (2.0 * map1_kappa - 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * cos_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * (0.4096 * M_PI * (2.0 * map1_kappa + 2.0) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * cos(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) - 0.4096 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-4.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]) * sin(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i])) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (r/Rmax) * (2.0 * map1_kappa + 2.0) * sin_theta[i]) * cos(M_PI * (r/Rmax) * ((-2.0) * map1_delta * (r/Rmax) - 2.0 * map1_kappa * cos_theta[i] + 2.0 * cos_theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin(theta) + 2.0 * (r/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * (r/Rmax) * cos(theta))); -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r[i]/Rmax) * sin(theta) + 2.0 * (r[i]/Rmax) * sin(theta))) * cos(M_PI * ((-2.0) * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) - 2.0 * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * (r[i]/Rmax) * cos(theta))); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(M_PI * (2.0 * map1_kappa * (r/Rmax) * sin_theta[i] + 2.0 * (r/Rmax) * sin_theta[i])) * cos(M_PI * ((-2.0) * map1_delta * ((r/Rmax) * (r/Rmax)) - 2.0 * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * (r/Rmax) * cos_theta[i])); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6ZoniShiftedTriangular.cpp b/src/test_cases/CartesianR6ZoniShiftedTriangular.cpp deleted file mode 100644 index 7a8098e5..00000000 --- a/src/test_cases/CartesianR6ZoniShiftedTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6ZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6ZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/CartesianR6ZoniTriangular.cpp b/src/test_cases/CartesianR6ZoniTriangular.cpp deleted file mode 100644 index 42aaa013..00000000 --- a/src/test_cases/CartesianR6ZoniTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// CartesianR6 simulates solution (23) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "CartesianR6ZoniTriangular.h" -#include -#include - - -/*........................................*/ -double CartesianR6ZoniTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void CartesianR6ZoniTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void CartesianR6ZoniTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void CartesianR6ZoniTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r[i]/Rmax)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (r[i]/Rmax) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (r[i]/Rmax) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * pow(cos(theta), 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 1.6384 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 12.288 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 9.8304 * M_PI * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 29.4912 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 12.288 * pow(((r[i]/Rmax) - 1.0), 4.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(theta) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 0.8192 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 4.9152 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0)) - 0.4096 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * pow(sin(theta), 2.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 1.6384 * M_PI * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(theta) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * M_PI * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 0.8192 * M_PI * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 5.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-((-(r/Rmax)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (r/Rmax) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (r/Rmax) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow((2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * M_PI * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.6384 * (M_PI * M_PI) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * pow(cos_theta[i], 2.0) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 1.6384 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 4.9152 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 12.288 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 4.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 4.9152 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 9.8304 * M_PI * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 29.4912 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 12.288 * pow(((r/Rmax) - 1.0), 4.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.8192 * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos_theta[i] * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 0.8192 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 4.9152 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-0.8192) * M_PI * map2_epsilon * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0)) - 0.4096 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) - 1.6384 * (M_PI * M_PI) * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * pow(sin_theta[i], 2.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 1.6384 * M_PI * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin_theta[i] * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * ((-2.0) * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * M_PI * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * (2.0 * M_PI * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * M_PI * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * cos(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 0.8192 * M_PI * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 5.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon) + 2.4576 * pow(((r/Rmax) - 1.0), 5.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void CartesianR6ZoniTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void CartesianR6ZoniTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double CartesianR6ZoniTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); -} -/*........................................*/ -void CartesianR6ZoniTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r[i]/Rmax) - 1.0), 6.0) * pow(((r[i]/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ -void CartesianR6ZoniTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow(((r/Rmax) - 1.0), 6.0) * pow(((r/Rmax) + 1.0), 6.0) * sin(2.0 * M_PI * map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * cos(2.0 * M_PI * (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroSonnendruckerCircular.cpp b/src/test_cases/PolarR6GyroSonnendruckerCircular.cpp deleted file mode 100644 index 04b296e2..00000000 --- a/src/test_cases/PolarR6GyroSonnendruckerCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroSonnendruckerCircular.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - pow((r/Rmax), 4.0) * ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - pow((r[i]/Rmax), 4.0) * ((r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - 5.03290747193186 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) / (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta))); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - pow((r/Rmax), 4.0) * ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroSonnendruckerShafranov.cpp b/src/test_cases/PolarR6GyroSonnendruckerShafranov.cpp deleted file mode 100644 index 45337b32..00000000 --- a/src/test_cases/PolarR6GyroSonnendruckerShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroSonnendruckerShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - pow((r/Rmax), 4.0) * ((-9.0112) * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - pow((r[i]/Rmax), 4.0) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 22.6762679055362 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - pow((r/Rmax), 4.0) * ((-9.0112) * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroSonnendruckerTriangular.cpp b/src/test_cases/PolarR6GyroSonnendruckerTriangular.cpp deleted file mode 100644 index a2b5fd84..00000000 --- a/src/test_cases/PolarR6GyroSonnendruckerTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroSonnendruckerTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - pow((r/Rmax), 4.0) * (4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) - pow((r[i]/Rmax), 4.0) * (4.5056 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 22.6762679055362 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]) / (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) - pow((r/Rmax), 4.0) * (4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::coeffs2(double r, double Rmax) const -{ - return pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)), (double)((-1))); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = pow((0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)), (double)((-1))); - } -} -/*........................................*/ -double PolarR6GyroSonnendruckerTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroSonnendruckerTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniCircular.cpp b/src/test_cases/PolarR6GyroZoniCircular.cpp deleted file mode 100644 index 95086adc..00000000 --- a/src/test_cases/PolarR6GyroZoniCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniCircular.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroZoniCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) - pow((r/Rmax), 4.0) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0))); -} -/*........................................*/ -void PolarR6GyroZoniCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) - pow((r[i]/Rmax), 4.0) * ((r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0))); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) - pow((r/Rmax), 4.0) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0))); - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6GyroZoniCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6GyroZoniCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniShafranov.cpp b/src/test_cases/PolarR6GyroZoniShafranov.cpp deleted file mode 100644 index e5fe6c0c..00000000 --- a/src/test_cases/PolarR6GyroZoniShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) - pow((r/Rmax), 4.0) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) - pow((r[i]/Rmax), 4.0) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) - pow((r/Rmax), 4.0) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniShiftedCircular.cpp b/src/test_cases/PolarR6GyroZoniShiftedCircular.cpp deleted file mode 100644 index fc0e8a60..00000000 --- a/src/test_cases/PolarR6GyroZoniShiftedCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) - pow((r/Rmax), 4.0) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0))); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) - pow((r[i]/Rmax), 4.0) * ((r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0))); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) - pow((r/Rmax), 4.0) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0))); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniShiftedCulham.cpp b/src/test_cases/PolarR6GyroZoniShiftedCulham.cpp deleted file mode 100644 index f3743745..00000000 --- a/src/test_cases/PolarR6GyroZoniShiftedCulham.cpp +++ /dev/null @@ -1,662 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniShiftedCulham.h" -#include -#include -#include -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::my_sum(std::array& f, int64_t start_idx, int64_t end_idx) const -{ - int64_t i; - double result; - result = 0.0; - #pragma omp parallel for reduction(+: result) - for (i = start_idx; i < end_idx; i += 1) - { - result += f[i]; - } - return result; -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::q(double rr) const -{ - return 0.8 - 0.1 * (rr * rr); -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::dq(double rr) const -{ - return (-0.2) * rr; -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::p(double rr) const -{ - return 100000.0 - 90000.0 * (rr * rr); -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::dp(double rr) const -{ - return (-180000.0) * rr; -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::dg(double rr, double g) const -{ - return ((-g) * (0.0625000000000001 * (rr * rr) / pow((1.0 - 0.125 * (rr * rr)), 2.0) + 2.0 / (4.0 - 0.5 * (rr * rr))) + 2.261946711816e-06 * (4.0 - 0.5 * (rr * rr)) / g) / (rr / (4.0 - 0.5 * (rr * rr)) + (4.0 - 0.5 * (rr * rr)) / (g * rr)); -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::double_deriv(double rr, double c, double g, double dg, double val, double d_val) const -{ - return c * val / (rr * rr) - d_val * (pow(rr, (double)((-1))) + (4.0 - 0.5 * (rr * rr)) * (2.0 * dg * rr / (4.0 - 0.5 * (rr * rr)) + 0.125 * g * (rr * rr) / pow((1.0 - 0.125 * (rr * rr)), 2.0) + 2.0 * g / (4.0 - 0.5 * (rr * rr))) / (g * rr)); -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::g(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return g_array[ri]; - } - else - { - m = (g_array[ri + 1] - g_array[ri]) / dr; - c = g_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::Delta(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return Delta_array[ri]; - } - else - { - m = (Delta_array[ri + 1] - Delta_array[ri]) / dr; - c = Delta_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::Delta_prime(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return Delta_prime_array[ri]; - } - else - { - m = (Delta_prime_array[ri + 1] - Delta_prime_array[ri]) / dr; - c = Delta_prime_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::E(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return E_array[ri]; - } - else - { - m = (E_array[ri + 1] - E_array[ri]) / dr; - c = E_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::T(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return T_array[ri]; - } - else - { - m = (T_array[ri + 1] - T_array[ri]) / dr; - c = T_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::E_prime(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return E_prime_array[ri]; - } - else - { - m = (E_prime_array[ri + 1] - E_prime_array[ri]) / dr; - c = E_prime_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::T_prime(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return T_prime_array[ri]; - } - else - { - m = (T_prime_array[ri + 1] - T_prime_array[ri]) / dr; - c = T_prime_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::P(double rr) const -{ - if (rr == 0) - { - return 0.0; - } - else - { - return 0.005 * pow(rr, 3.0) + 0.1 * rr * Delta(rr) - 0.1 * pow(E(rr), 2.0) - pow(T(rr), 2.0) / rr; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::dP(double rr) const -{ - if (rr == 0) - { - return 0.0; - } - else - { - return 0.015 * (rr * rr) + 0.1 * rr * Delta_prime(rr) + 0.1 * Delta(rr) - 0.2 * E(rr) * E_prime(rr) - 2.0 * T(rr) * T_prime(rr) / rr + pow(T(rr), 2.0) / (rr * rr); - } -} -/*........................................*/ -PolarR6GyroZoniShiftedCulham::PolarR6GyroZoniShiftedCulham() -{ - double rr; - double dr; - double dr_h; - std::array r; - int64_t i; - double dg_1; - double dE_1; - double dT_1; - double ddE_1; - double ddT_1; - double r2; - double g_2; - double dg_2; - double E_2; - double T_2; - double dE_2; - double dT_2; - double ddE_2; - double ddT_2; - double g_3; - double dg_3; - double E_3; - double T_3; - double dE_3; - double dT_3; - double ddE_3; - double ddT_3; - double g_4; - double dg_4; - double E_4; - double T_4; - double dE_4; - double dT_4; - double ddE_4; - double ddT_4; - double current_Ea; - double current_Ta; - std::array f; - std::array integ_contents; - double integral; - double current_Delta_a; - size_t i_0001; - rr = 0.0; - dr = 1.0 / 1000; - dr_h = dr * 0.5; - g_array[0] = 1.0; - E_array[0] = 0.0; - E_prime_array[0] = 1.0; - T_array[0] = 0.0; - T_prime_array[0] = 0.0; - r[0] = rr; - rr += dr; - r[1] = rr; - g_array[1] = 1.0; - E_array[1] = rr; - E_prime_array[1] = 1.0; - T_array[1] = rr * rr; - T_prime_array[1] = 2 * rr; - for (i = 1; i < 1000; i += 1) - { - /*Step 1*/ - dg_1 = dg(rr, g_array[i]); - dE_1 = E_prime_array[i]; - dT_1 = T_prime_array[i]; - ddE_1 = double_deriv(rr, 3.0, g_array[i], dg_1, E_array[i], E_prime_array[i]); - ddT_1 = double_deriv(rr, 8.0, g_array[i], dg_1, T_array[i], T_prime_array[i]); - /*Step 2*/ - r2 = rr + dr_h; - g_2 = g_array[i] + dr_h * dg_1; - dg_2 = dg(r2, g_2); - E_2 = E_array[i] + dE_1 * dr_h; - T_2 = T_array[i] + dT_1 * dr_h; - dE_2 = E_prime_array[i] + ddE_1 * dr_h; - dT_2 = T_prime_array[i] + ddT_1 * dr_h; - ddE_2 = double_deriv(r2, 3.0, g_2, dg_2, E_2, dE_2); - ddT_2 = double_deriv(r2, 8.0, g_2, dg_2, T_2, dT_2); - /*Step 3*/ - g_3 = g_array[i] + dr_h * dg_2; - dg_3 = dg(r2, g_3); - E_3 = E_array[i] + dE_2 * dr_h; - T_3 = T_array[i] + dT_2 * dr_h; - dE_3 = E_prime_array[i] + ddE_2 * dr_h; - dT_3 = T_prime_array[i] + ddT_2 * dr_h; - ddE_3 = double_deriv(r2, 3.0, g_3, dg_3, E_3, dE_3); - ddT_3 = double_deriv(r2, 8.0, g_3, dg_3, T_3, dT_3); - /*Step 4*/ - rr = rr + dr; - g_4 = g_array[i] + dr * dg_3; - dg_4 = dg(rr, g_4); - E_4 = E_array[i] + dE_3 * dr; - T_4 = T_array[i] + dT_3 * dr; - dE_4 = E_prime_array[i] + ddE_3 * dr; - dT_4 = T_prime_array[i] + ddT_3 * dr; - ddE_4 = double_deriv(rr, 3.0, g_4, dg_4, E_4, dE_4); - ddT_4 = double_deriv(rr, 8.0, g_4, dg_4, T_4, dT_4); - g_array[i + 1] = g_array[i] + dr * (dg_1 + 2 * dg_2 + 2 * dg_3 + dg_4) / 6.0; - E_array[i + 1] = E_array[i] + dr * (dE_1 + 2 * dE_2 + 2 * dE_3 + dE_4) / 6.0; - T_array[i + 1] = T_array[i] + dr * (dT_1 + 2 * dT_2 + 2 * dT_3 + dT_4) / 6.0; - E_prime_array[i + 1] = E_prime_array[i] + dr * (ddE_1 + 2 * ddE_2 + 2 * ddE_3 + ddE_4) / 6.0; - T_prime_array[i + 1] = T_prime_array[i] + dr * (ddT_1 + 2 * ddT_2 + 2 * ddT_3 + ddT_4) / 6.0; - r[i + 1] = rr; - } - current_Ea = E(1.0); - current_Ta = T(1.0); - for (i_0001 = 0; i_0001 < E_array.size(); i_0001 += 1) - { - E_array[i_0001] = 0.25 * E_array[i_0001] / current_Ea; - } - for (i_0001 = 0; i_0001 < T_array.size(); i_0001 += 1) - { - T_array[i_0001] = 0.1 * T_array[i_0001] / current_Ta; - } - for (i_0001 = 0; i_0001 < E_prime_array.size(); i_0001 += 1) - { - E_prime_array[i_0001] = 0.25 * E_prime_array[i_0001] / current_Ea; - } - for (i_0001 = 0; i_0001 < T_prime_array.size(); i_0001 += 1) - { - T_prime_array[i_0001] = 0.1 * T_prime_array[i_0001] / current_Ta; - } - for (i_0001 = 0; i_0001 < f.size(); i_0001 += 1) - { - f[i_0001] = r[i_0001] * g_array[i_0001] / 5.0 / q(r[i_0001]); - } - for (i_0001 = 0; i_0001 < integ_contents.size(); i_0001 += 1) - { - integ_contents[i_0001] = r[i_0001] * (f[i_0001] * f[i_0001]) - 2 * (r[i_0001] * r[i_0001]) * 1.25663706212e-06 * dp(r[i_0001]) / (1.0 * 1.0); - } - Delta_prime_array[0] = 0; - Delta_array[0] = 0; - integral = 0.0; - for (i = 1; i < 1000 + 1; i += 1) - { - integral += dr * (integ_contents[i - 1] + integ_contents[i]) * 0.5; - Delta_prime_array[i] = (-integral) / (5.0 * r[i] * pow(f[i], 2.0)); - Delta_array[i] = Delta_array[i - 1] + dr * 0.5 * (Delta_prime_array[i - 1] + Delta_prime_array[i]); - } - current_Delta_a = Delta(1.0); - for (i_0001 = 0; i_0001 < Delta_array.size(); i_0001 += 1) - { - Delta_array[i_0001] -= current_Delta_a; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::x(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta) + Delta((r/Rmax)) - E((r/Rmax)) * cos(theta) - P((r/Rmax)) * cos(theta) + T((r/Rmax)) * cos(2.0 * theta) + 5.0; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::x(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta) + Delta((r[i]/Rmax)) - E((r[i]/Rmax)) * cos(theta) - P((r[i]/Rmax)) * cos(theta) + T((r[i]/Rmax)) * cos(2.0 * theta) + 5.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::x(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i] + Delta((r/Rmax)) - E((r/Rmax)) * cos_theta[i] - P((r/Rmax)) * cos_theta[i] + T((r/Rmax)) * cos(2.0 * theta[i]) + 5.0; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::y(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta) - E((r/Rmax)) * sin(theta) - P((r/Rmax)) * sin(theta) - T((r/Rmax)) * sin(2.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::y(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) - E((r[i]/Rmax)) * sin(theta) - P((r[i]/Rmax)) * sin(theta) - T((r[i]/Rmax)) * sin(2.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::y(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] - E((r/Rmax)) * sin_theta[i] - P((r/Rmax)) * sin_theta[i] - T((r/Rmax)) * sin(2.0 * theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_rr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (Delta_prime((r/Rmax)) - E_prime((r/Rmax)) * cos(theta) + T_prime((r/Rmax)) * cos(2.0 * theta) - dP((r/Rmax)) * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_rr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (Delta_prime((r[i]/Rmax)) - E_prime((r[i]/Rmax)) * cos(theta) + T_prime((r[i]/Rmax)) * cos(2.0 * theta) - dP((r[i]/Rmax)) * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_rr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (Delta_prime((r/Rmax)) - E_prime((r/Rmax)) * cos_theta[i] + T_prime((r/Rmax)) * cos(2.0 * theta[i]) - dP((r/Rmax)) * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_rt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta) + E((r/Rmax)) * sin(theta) + P((r/Rmax)) * sin(theta) - 2.0 * T((r/Rmax)) * sin(2.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_rt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta) + E((r[i]/Rmax)) * sin(theta) + P((r[i]/Rmax)) * sin(theta) - 2.0 * T((r[i]/Rmax)) * sin(2.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_rt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i] + E((r/Rmax)) * sin_theta[i] + P((r/Rmax)) * sin_theta[i] - 2.0 * T((r/Rmax)) * sin(2.0 * theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_tr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-E_prime((r/Rmax))) * sin(theta) - T_prime((r/Rmax)) * sin(2.0 * theta) - dP((r/Rmax)) * sin(theta) + sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_tr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r[i]/Rmax))) * sin(theta) - T_prime((r[i]/Rmax)) * sin(2.0 * theta) - dP((r[i]/Rmax)) * sin(theta) + sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_tr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r/Rmax))) * sin_theta[i] - T_prime((r/Rmax)) * sin(2.0 * theta[i]) - dP((r/Rmax)) * sin_theta[i] + sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_tt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta) - E((r/Rmax)) * cos(theta) - P((r/Rmax)) * cos(theta) - 2.0 * T((r/Rmax)) * cos(2.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_tt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta) - E((r[i]/Rmax)) * cos(theta) - P((r[i]/Rmax)) * cos(theta) - 2.0 * T((r[i]/Rmax)) * cos(2.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_tt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i] - E((r/Rmax)) * cos_theta[i] - P((r/Rmax)) * cos_theta[i] - 2.0 * T((r/Rmax)) * cos(2.0 * theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_xr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-(r/Rmax)) * cos(theta) + E((r/Rmax)) * cos(theta) + P((r/Rmax)) * cos(theta) + 2.0 * T((r/Rmax)) * cos(2.0 * theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_xr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r[i]/Rmax)) * cos(theta) + E((r[i]/Rmax)) * cos(theta) + P((r[i]/Rmax)) * cos(theta) + 2.0 * T((r[i]/Rmax)) * cos(2.0 * theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_xr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r/Rmax)) * cos_theta[i] + E((r/Rmax)) * cos_theta[i] + P((r/Rmax)) * cos_theta[i] + 2.0 * T((r/Rmax)) * cos(2.0 * theta[i])) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_xq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-(r/Rmax)) * sin(theta) + E((r/Rmax)) * sin(theta) + P((r/Rmax)) * sin(theta) - 2.0 * T((r/Rmax)) * sin(2.0 * theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_xq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r[i]/Rmax)) * sin(theta) + E((r[i]/Rmax)) * sin(theta) + P((r[i]/Rmax)) * sin(theta) - 2.0 * T((r[i]/Rmax)) * sin(2.0 * theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_xq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r/Rmax)) * sin_theta[i] + E((r/Rmax)) * sin_theta[i] + P((r/Rmax)) * sin_theta[i] - 2.0 * T((r/Rmax)) * sin(2.0 * theta[i])) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_yr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-E_prime((r/Rmax))) * sin(theta) - T_prime((r/Rmax)) * sin(2.0 * theta) - dP((r/Rmax)) * sin(theta) + sin(theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_yr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r[i]/Rmax))) * sin(theta) - T_prime((r[i]/Rmax)) * sin(2.0 * theta) - dP((r[i]/Rmax)) * sin(theta) + sin(theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_yr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r/Rmax))) * sin_theta[i] - T_prime((r/Rmax)) * sin(2.0 * theta[i]) - dP((r/Rmax)) * sin_theta[i] + sin_theta[i]) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::J_yq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-Delta_prime((r/Rmax))) + E_prime((r/Rmax)) * cos(theta) - T_prime((r/Rmax)) * cos(2.0 * theta) + dP((r/Rmax)) * cos(theta) - cos(theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_yq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-Delta_prime((r[i]/Rmax))) + E_prime((r[i]/Rmax)) * cos(theta) - T_prime((r[i]/Rmax)) * cos(2.0 * theta) + dP((r[i]/Rmax)) * cos(theta) - cos(theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::J_yq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-Delta_prime((r/Rmax))) + E_prime((r/Rmax)) * cos_theta[i] - T_prime((r/Rmax)) * cos(2.0 * theta[i]) + dP((r/Rmax)) * cos_theta[i] - cos_theta[i]) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::coeffs2(double r, double Rmax) const -{ - return 1.0 * exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::rho_glob(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::rho_glob(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::rho_glob(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::rho_pole(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::rho_pole(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::rho_pole(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedCulham::phi_exact(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::phi_exact(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedCulham::phi_exact(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniShiftedShafranov.cpp b/src/test_cases/PolarR6GyroZoniShiftedShafranov.cpp deleted file mode 100644 index 7975c455..00000000 --- a/src/test_cases/PolarR6GyroZoniShiftedShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) - pow((r/Rmax), 4.0) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) - pow((r[i]/Rmax), 4.0) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) - pow((r/Rmax), 4.0) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniShiftedTriangular.cpp b/src/test_cases/PolarR6GyroZoniShiftedTriangular.cpp deleted file mode 100644 index 92ed8b7a..00000000 --- a/src/test_cases/PolarR6GyroZoniShiftedTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) - pow((r/Rmax), 4.0) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) - pow((r[i]/Rmax), 4.0) * (4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) - pow((r/Rmax), 4.0) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6GyroZoniTriangular.cpp b/src/test_cases/PolarR6GyroZoniTriangular.cpp deleted file mode 100644 index 037d654a..00000000 --- a/src/test_cases/PolarR6GyroZoniTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6GyroZoniTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6GyroZoniTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6GyroZoniTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) - pow((r/Rmax), 4.0) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) - pow((r[i]/Rmax), 4.0) * (4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) - pow((r/Rmax), 4.0) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6GyroZoniTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::coeffs2(double r, double Rmax) const -{ - return exp(tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6GyroZoniTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6GyroZoniTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6GyroZoniTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6PoissonCircular.cpp b/src/test_cases/PolarR6PoissonCircular.cpp deleted file mode 100644 index eed84386..00000000 --- a/src/test_cases/PolarR6PoissonCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "PolarR6PoissonCircular.h" -#include -#include -#include - - -/*........................................*/ -double PolarR6PoissonCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6PoissonCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6PoissonCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6PoissonCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6PoissonCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6PoissonCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6PoissonCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6PoissonCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6PoissonCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-INT64_C(1)))); -} -/*........................................*/ -void PolarR6PoissonCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-INT64_C(1)))); - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-INT64_C(1)))); - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6PoissonCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6PoissonCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6PoissonCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6PoissonCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6PoissonCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6PoissonCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * (14.7456 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 1.0 * (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - 34.816 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)); -} -/*........................................*/ -void PolarR6PoissonCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * (14.7456 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 1.0 * (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - 34.816 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)); - } -} -/*........................................*/ -void PolarR6PoissonCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * (14.7456 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 1.0 * (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) - 34.816 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])); - } -} -/*........................................*/ -double PolarR6PoissonCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6PoissonCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6PoissonCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6PoissonCircular::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void PolarR6PoissonCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double PolarR6PoissonCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6PoissonCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6PoissonCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6PoissonCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6PoissonCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6PoissonShafranov.cpp b/src/test_cases/PolarR6PoissonShafranov.cpp deleted file mode 100644 index 1a2d79b0..00000000 --- a/src/test_cases/PolarR6PoissonShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "PolarR6PoissonShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6PoissonShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6PoissonShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6PoissonShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6PoissonShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6PoissonShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6PoissonShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6PoissonShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6PoissonShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6PoissonShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6PoissonShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6PoissonShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6PoissonShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 1.0 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 1.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 1.0 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 1.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6PoissonShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6PoissonShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6PoissonShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void PolarR6PoissonShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6PoissonShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6PoissonShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6PoissonShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6PoissonShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6PoissonTriangular.cpp b/src/test_cases/PolarR6PoissonTriangular.cpp deleted file mode 100644 index 159ae12f..00000000 --- a/src/test_cases/PolarR6PoissonTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "PolarR6PoissonTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6PoissonTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6PoissonTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6PoissonTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6PoissonTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6PoissonTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6PoissonTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6PoissonTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6PoissonTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6PoissonTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6PoissonTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6PoissonTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6PoissonTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6PoissonTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 1.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6PoissonTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * (4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 1.0 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 1.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 1.0 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 1.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6PoissonTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6PoissonTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6PoissonTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6PoissonTriangular::coeffs1(double r, double Rmax) const -{ - return 1.0; -} -/*........................................*/ -void PolarR6PoissonTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0; - } -} -/*........................................*/ -double PolarR6PoissonTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6PoissonTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6PoissonTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6PoissonTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6PoissonTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6SonnendruckerCircular.cpp b/src/test_cases/PolarR6SonnendruckerCircular.cpp deleted file mode 100644 index 8bc1339f..00000000 --- a/src/test_cases/PolarR6SonnendruckerCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6SonnendruckerCircular.h" -#include -#include - - -/*........................................*/ -double PolarR6SonnendruckerCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta))); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) - 5.03290747193186 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) / (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta))); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) / (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]))); - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6SonnendruckerCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6SonnendruckerCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6SonnendruckerCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6SonnendruckerCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6SonnendruckerShafranov.cpp b/src/test_cases/PolarR6SonnendruckerShafranov.cpp deleted file mode 100644 index 4a735338..00000000 --- a/src/test_cases/PolarR6SonnendruckerShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6SonnendruckerShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6SonnendruckerShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 22.6762679055362 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) * (208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / (sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) * (208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0)) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6SonnendruckerShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6SonnendruckerTriangular.cpp b/src/test_cases/PolarR6SonnendruckerTriangular.cpp deleted file mode 100644 index 7d10608e..00000000 --- a/src/test_cases/PolarR6SonnendruckerTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6SonnendruckerTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6SonnendruckerTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * (4.5056 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - 22.6762679055362 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 5.03290747193186 * (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / ((208.641975308642 * pow(((r[i]/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - 22.6762679055362 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 5.03290747193186 * (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / ((208.641975308642 * pow(((r/Rmax) - 0.769230769230769), 2.0) + 1.0) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 27.0336 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::coeffs1(double r, double Rmax) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - return 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r/Rmax) - 11.1111111111111); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1, Eq. (2.3) with Rmax=1.3 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.452961672473868 - 0.348432055749129 * atan(14.4444444444444 * (r[i]/Rmax) - 11.1111111111111); - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6SonnendruckerTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6SonnendruckerTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6ZoniCircular.cpp b/src/test_cases/PolarR6ZoniCircular.cpp deleted file mode 100644 index 7b3c40ae..00000000 --- a/src/test_cases/PolarR6ZoniCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6ZoniCircular.h" -#include -#include - - -/*........................................*/ -double PolarR6ZoniCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6ZoniCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6ZoniCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6ZoniCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6ZoniCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6ZoniCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void PolarR6ZoniCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6ZoniCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6ZoniCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6ZoniCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6ZoniCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6ZoniCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6ZoniCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0))); -} -/*........................................*/ -void PolarR6ZoniCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0))); - } -} -/*........................................*/ -void PolarR6ZoniCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0))); - } -} -/*........................................*/ -double PolarR6ZoniCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6ZoniCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6ZoniCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6ZoniCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6ZoniCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6ZoniCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6ZoniShafranov.cpp b/src/test_cases/PolarR6ZoniShafranov.cpp deleted file mode 100644 index de87f64e..00000000 --- a/src/test_cases/PolarR6ZoniShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6ZoniShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6ZoniShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6ZoniShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6ZoniShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6ZoniShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6ZoniShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6ZoniShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShafranov::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6ZoniShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6ZoniShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6ZoniShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6ZoniShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6ZoniShiftedCircular.cpp b/src/test_cases/PolarR6ZoniShiftedCircular.cpp deleted file mode 100644 index 969760b1..00000000 --- a/src/test_cases/PolarR6ZoniShiftedCircular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6ZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double PolarR6ZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0))); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0))); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0))); - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6ZoniShiftedShafranov.cpp b/src/test_cases/PolarR6ZoniShiftedShafranov.cpp deleted file mode 100644 index 45be29e6..00000000 --- a/src/test_cases/PolarR6ZoniShiftedShafranov.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6ZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double PolarR6ZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r[i]/Rmax) * (map1_kappa - 1.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * ((-9.0112) * map1_delta * (r/Rmax) * (map1_kappa - 1.0) * pow(((r/Rmax) - 1.0), 6.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6ZoniShiftedTriangular.cpp b/src/test_cases/PolarR6ZoniShiftedTriangular.cpp deleted file mode 100644 index 626d1eb0..00000000 --- a/src/test_cases/PolarR6ZoniShiftedTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6ZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6ZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * (4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6ZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/PolarR6ZoniTriangular.cpp b/src/test_cases/PolarR6ZoniTriangular.cpp deleted file mode 100644 index 24de7daf..00000000 --- a/src/test_cases/PolarR6ZoniTriangular.cpp +++ /dev/null @@ -1,306 +0,0 @@ -// PolarR6 simulates solution (22) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 -#include "PolarR6ZoniTriangular.h" -#include -#include - - -/*........................................*/ -double PolarR6ZoniTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void PolarR6ZoniTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void PolarR6ZoniTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double PolarR6ZoniTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6ZoniTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void PolarR6ZoniTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void PolarR6ZoniTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void PolarR6ZoniTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void PolarR6ZoniTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void PolarR6ZoniTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void PolarR6ZoniTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void PolarR6ZoniTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void PolarR6ZoniTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void PolarR6ZoniTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r[i]/Rmax), 4.0)) * (4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 27.0336 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (12.288 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 4.0) * cos(11.0 * theta) + 17.2032 * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (10.0 * pow(tanh(10.0 * (r[i]/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 49.5616 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * cos(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - 4.5056 * pow(((r[i]/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) * sin(11.0 * theta) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-27.0336) * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * sin(11.0 * theta) - 27.0336 * pow(((r[i]/Rmax) - 1.0), 6.0) * sin(11.0 * theta)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (2.4576 * (r[i]/Rmax) * pow(((r[i]/Rmax) - 1.0), 5.0) * cos(11.0 * theta) + 2.4576 * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow((r/Rmax), 4.0)) * (4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 4.5056 * (r/Rmax) * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 27.0336 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (12.288 * (r/Rmax) * pow(((r/Rmax) - 1.0), 4.0) * cos(11.0 * theta[i]) + 17.2032 * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (10.0 * pow(tanh(10.0 * (r/Rmax) - 5.0), 2.0) - 10.0) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 49.5616 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * cos(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - 4.5056 * pow(((r/Rmax) - 1.0), 6.0) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) * sin(11.0 * theta[i]) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-27.0336) * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * sin(11.0 * theta[i]) - 27.0336 * pow(((r/Rmax) - 1.0), 6.0) * sin(11.0 * theta[i])) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + 6.0 * (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (2.4576 * (r/Rmax) * pow(((r/Rmax) - 1.0), 5.0) * cos(11.0 * theta[i]) + 2.4576 * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(10.0 * (r/Rmax) - 5.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void PolarR6ZoniTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniTriangular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(10.0 * (r/Rmax) - 5.0)); -} -/*........................................*/ -void PolarR6ZoniTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(10.0 * (r[i]/Rmax) - 5.0)); - } -} -/*........................................*/ -double PolarR6ZoniTriangular::coeffs2(double r, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void PolarR6ZoniTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double PolarR6ZoniTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta); -} -/*........................................*/ -void PolarR6ZoniTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r[i]/Rmax), 6.0) * pow(((r[i]/Rmax) - 1.0), 6.0) * cos(11.0 * theta); - } -} -/*........................................*/ -void PolarR6ZoniTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.4096 * pow((r/Rmax), 6.0) * pow(((r/Rmax) - 1.0), 6.0) * cos(11.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/README.md b/src/test_cases/README.md deleted file mode 100644 index 6a9d9e60..00000000 --- a/src/test_cases/README.md +++ /dev/null @@ -1,16 +0,0 @@ -The following files define the geometry, coefficients of the ordinary differential equation and the manufactured solution. We always solve - -$-\nabla \cdot \left( \alpha \nabla u \right) + \beta u = f\quad \text{ in }\quad \Omega$ - -The naming is defined in `constants.h` and it follows the following rules: - -- The first part, e.g., `PolarR6` or `CartesianR6`, defines the manufactured solution. -- The **potential** second part `Gyro` or empty, defines if the $\beta$ coefficient is nontrivial or zero. -- The following part, e.g., `Sonnendrucker` or `Poisson`, defines the value of the $\alpha$ coefficient. -- The last part, e.g., `Shafranov` or `Triangular`, defines the geometry to be used - -For the particular solutions, see: -- Bourne et al. - Solver comparison for Poisson-like equations on tokamak geometries (2023) https://doi.org/10.1016/j.jcp.2023.112249 -- Kuehn, Kruse, Ruede - Implicitly extrapolated geometric multigrid on disk-like domains for the gyrokinetic Poisson equation from fusion plasma applications (2022) https://doi.org/10.1007/s10915-022-01802-1 - -A great thanks to Emily Bourne for preparing these scripts! \ No newline at end of file diff --git a/src/test_cases/RefinedGyroZoniShiftedCircular.cpp b/src/test_cases/RefinedGyroZoniShiftedCircular.cpp deleted file mode 100644 index f070e718..00000000 --- a/src/test_cases/RefinedGyroZoniShiftedCircular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "RefinedGyroZoniShiftedCircular.h" -#include -#include - - -/*........................................*/ -double RefinedGyroZoniShiftedCircular::x(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::x(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::x(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::y(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::y(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::y(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_rr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (cos(theta))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_rr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos(theta))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_rr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (cos_theta[i])/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_rt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_rt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_rt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_tr(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (sin(theta))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_tr(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin(theta))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_tr(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (sin_theta[i])/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_tt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_tt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_tt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_xs(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_xs(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin(theta), 2.0)) / cos(theta) + pow(cos(theta), (double)((-1))); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_xs(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-pow(sin_theta[i], 2.0)) / cos_theta[i] + pow(cos_theta[i], (double)((-1))); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_xt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return sin(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_xt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_xt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_ys(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return (-sin(theta)) / (r/Rmax); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_ys(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin(theta)) / (r[i]/Rmax); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_ys(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-sin_theta[i]) / (r/Rmax); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::J_yt(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return cos(theta) / (r/Rmax); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_yt(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos(theta) / (r[i]/Rmax); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::J_yt(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = cos_theta[i] / (r/Rmax); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::rho_glob(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 1.0 * (((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) - ((r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((10000.0 * pow((0.45 - (r/Rmax)), 2.0) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta) + (44444444.4444444 * pow((0.9 - (r/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (21.0 * (7.0102993702666e-14 * ((r/Rmax) * (r/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + 9.0 * ((-0.0165846035000287) * ((r/Rmax) * (r/Rmax)) + 0.0162264454441452 * (r/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / (r/Rmax)) / (r/Rmax); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::rho_glob(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * (((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) - ((r[i]/Rmax) * (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (r[i]/Rmax) * ((10000.0 * pow((0.45 - (r[i]/Rmax)), 2.0) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta) + (44444444.4444444 * pow((0.9 - (r[i]/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) + (21.0 * (7.0102993702666e-14 * ((r[i]/Rmax) * (r[i]/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + 9.0 * ((-0.0165846035000287) * ((r[i]/Rmax) * (r[i]/Rmax)) + 0.0162264454441452 * (r[i]/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / (r[i]/Rmax)) / (r[i]/Rmax); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::rho_glob(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * (((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i])) * exp(tanh(20.0 * (r/Rmax) - 14.0)) - ((r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (r/Rmax) * ((10000.0 * pow((0.45 - (r/Rmax)), 2.0) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]) + (44444444.4444444 * pow((0.9 - (r/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) + (21.0 * (7.0102993702666e-14 * ((r/Rmax) * (r/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + 9.0 * ((-0.0165846035000287) * ((r/Rmax) * (r/Rmax)) + 0.0162264454441452 * (r/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / (r/Rmax)) / (r/Rmax); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::rho_pole(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::rho_pole(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::rho_pole(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::coeffs1(double r, double Rmax) const -{ - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::coeffs2(double r, double Rmax) const -{ - return 1.0 * exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCircular::phi_exact(double r, double theta, double unused_1, double unused_2, double Rmax) const -{ - return ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::phi_exact(std::vector const& r, double theta, double unused_1, double unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCircular::phi_exact(double r, std::vector const& theta, double unused_1, double unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/RefinedGyroZoniShiftedCulham.cpp b/src/test_cases/RefinedGyroZoniShiftedCulham.cpp deleted file mode 100644 index 7dccf508..00000000 --- a/src/test_cases/RefinedGyroZoniShiftedCulham.cpp +++ /dev/null @@ -1,661 +0,0 @@ -#include "RefinedGyroZoniShiftedCulham.h" -#include -#include -#include -#include -#include - - -/*........................................*/ -double RefinedGyroZoniShiftedCulham::my_sum(std::array& f, int64_t start_idx, int64_t end_idx) const -{ - int64_t i; - double result; - result = 0.0; - #pragma omp parallel for reduction(+: result) - for (i = start_idx; i < end_idx; i += 1) - { - result += f[i]; - } - return result; -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::q(double rr) const -{ - return 0.8 - 0.1 * (rr * rr); -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::dq(double rr) const -{ - return (-0.2) * rr; -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::p(double rr) const -{ - return 100000.0 - 90000.0 * (rr * rr); -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::dp(double rr) const -{ - return (-180000.0) * rr; -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::dg(double rr, double g) const -{ - return ((-g) * (0.0625000000000001 * (rr * rr) / pow((1.0 - 0.125 * (rr * rr)), 2.0) + 2.0 / (4.0 - 0.5 * (rr * rr))) + 2.261946711816e-06 * (4.0 - 0.5 * (rr * rr)) / g) / (rr / (4.0 - 0.5 * (rr * rr)) + (4.0 - 0.5 * (rr * rr)) / (g * rr)); -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::double_deriv(double rr, double c, double g, double dg, double val, double d_val) const -{ - return c * val / (rr * rr) - d_val * (pow(rr, (double)((-1))) + (4.0 - 0.5 * (rr * rr)) * (2.0 * dg * rr / (4.0 - 0.5 * (rr * rr)) + 0.125 * g * (rr * rr) / pow((1.0 - 0.125 * (rr * rr)), 2.0) + 2.0 * g / (4.0 - 0.5 * (rr * rr))) / (g * rr)); -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::g(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return g_array[ri]; - } - else - { - m = (g_array[ri + 1] - g_array[ri]) / dr; - c = g_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::Delta(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return Delta_array[ri]; - } - else - { - m = (Delta_array[ri + 1] - Delta_array[ri]) / dr; - c = Delta_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::Delta_prime(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return Delta_prime_array[ri]; - } - else - { - m = (Delta_prime_array[ri + 1] - Delta_prime_array[ri]) / dr; - c = Delta_prime_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::E(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return E_array[ri]; - } - else - { - m = (E_array[ri + 1] - E_array[ri]) / dr; - c = E_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::T(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return T_array[ri]; - } - else - { - m = (T_array[ri + 1] - T_array[ri]) / dr; - c = T_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::E_prime(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return E_prime_array[ri]; - } - else - { - m = (E_prime_array[ri + 1] - E_prime_array[ri]) / dr; - c = E_prime_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::T_prime(double rr) const -{ - int64_t ri; - double dr; - double m; - double c; - ri = (int64_t)(rr * 1000 / 1.0); - dr = 1.0 / 1000.0; - if (ri == 1000) - { - return T_prime_array[ri]; - } - else - { - m = (T_prime_array[ri + 1] - T_prime_array[ri]) / dr; - c = T_prime_array[ri] - m * ri * dr; - return m * rr + c; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::P(double rr) const -{ - if (rr == 0) - { - return 0.0; - } - else - { - return 0.005 * pow(rr, 3.0) + 0.1 * rr * Delta(rr) - 0.1 * pow(E(rr), 2.0) - pow(T(rr), 2.0) / rr; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::dP(double rr) const -{ - if (rr == 0) - { - return 0.0; - } - else - { - return 0.015 * (rr * rr) + 0.1 * rr * Delta_prime(rr) + 0.1 * Delta(rr) - 0.2 * E(rr) * E_prime(rr) - 2.0 * T(rr) * T_prime(rr) / rr + pow(T(rr), 2.0) / (rr * rr); - } -} -/*........................................*/ -RefinedGyroZoniShiftedCulham::RefinedGyroZoniShiftedCulham() -{ - double rr; - double dr; - double dr_h; - std::array r; - int64_t i; - double dg_1; - double dE_1; - double dT_1; - double ddE_1; - double ddT_1; - double r2; - double g_2; - double dg_2; - double E_2; - double T_2; - double dE_2; - double dT_2; - double ddE_2; - double ddT_2; - double g_3; - double dg_3; - double E_3; - double T_3; - double dE_3; - double dT_3; - double ddE_3; - double ddT_3; - double g_4; - double dg_4; - double E_4; - double T_4; - double dE_4; - double dT_4; - double ddE_4; - double ddT_4; - double current_Ea; - double current_Ta; - std::array f; - std::array integ_contents; - double integral; - double current_Delta_a; - size_t i_0001; - rr = 0.0; - dr = 1.0 / 1000; - dr_h = dr * 0.5; - g_array[0] = 1.0; - E_array[0] = 0.0; - E_prime_array[0] = 1.0; - T_array[0] = 0.0; - T_prime_array[0] = 0.0; - r[0] = rr; - rr += dr; - r[1] = rr; - g_array[1] = 1.0; - E_array[1] = rr; - E_prime_array[1] = 1.0; - T_array[1] = rr * rr; - T_prime_array[1] = 2 * rr; - for (i = 1; i < 1000; i += 1) - { - /*Step 1*/ - dg_1 = dg(rr, g_array[i]); - dE_1 = E_prime_array[i]; - dT_1 = T_prime_array[i]; - ddE_1 = double_deriv(rr, 3.0, g_array[i], dg_1, E_array[i], E_prime_array[i]); - ddT_1 = double_deriv(rr, 8.0, g_array[i], dg_1, T_array[i], T_prime_array[i]); - /*Step 2*/ - r2 = rr + dr_h; - g_2 = g_array[i] + dr_h * dg_1; - dg_2 = dg(r2, g_2); - E_2 = E_array[i] + dE_1 * dr_h; - T_2 = T_array[i] + dT_1 * dr_h; - dE_2 = E_prime_array[i] + ddE_1 * dr_h; - dT_2 = T_prime_array[i] + ddT_1 * dr_h; - ddE_2 = double_deriv(r2, 3.0, g_2, dg_2, E_2, dE_2); - ddT_2 = double_deriv(r2, 8.0, g_2, dg_2, T_2, dT_2); - /*Step 3*/ - g_3 = g_array[i] + dr_h * dg_2; - dg_3 = dg(r2, g_3); - E_3 = E_array[i] + dE_2 * dr_h; - T_3 = T_array[i] + dT_2 * dr_h; - dE_3 = E_prime_array[i] + ddE_2 * dr_h; - dT_3 = T_prime_array[i] + ddT_2 * dr_h; - ddE_3 = double_deriv(r2, 3.0, g_3, dg_3, E_3, dE_3); - ddT_3 = double_deriv(r2, 8.0, g_3, dg_3, T_3, dT_3); - /*Step 4*/ - rr = rr + dr; - g_4 = g_array[i] + dr * dg_3; - dg_4 = dg(rr, g_4); - E_4 = E_array[i] + dE_3 * dr; - T_4 = T_array[i] + dT_3 * dr; - dE_4 = E_prime_array[i] + ddE_3 * dr; - dT_4 = T_prime_array[i] + ddT_3 * dr; - ddE_4 = double_deriv(rr, 3.0, g_4, dg_4, E_4, dE_4); - ddT_4 = double_deriv(rr, 8.0, g_4, dg_4, T_4, dT_4); - g_array[i + 1] = g_array[i] + dr * (dg_1 + 2 * dg_2 + 2 * dg_3 + dg_4) / 6.0; - E_array[i + 1] = E_array[i] + dr * (dE_1 + 2 * dE_2 + 2 * dE_3 + dE_4) / 6.0; - T_array[i + 1] = T_array[i] + dr * (dT_1 + 2 * dT_2 + 2 * dT_3 + dT_4) / 6.0; - E_prime_array[i + 1] = E_prime_array[i] + dr * (ddE_1 + 2 * ddE_2 + 2 * ddE_3 + ddE_4) / 6.0; - T_prime_array[i + 1] = T_prime_array[i] + dr * (ddT_1 + 2 * ddT_2 + 2 * ddT_3 + ddT_4) / 6.0; - r[i + 1] = rr; - } - current_Ea = E(1.0); - current_Ta = T(1.0); - for (i_0001 = 0; i_0001 < E_array.size(); i_0001 += 1) - { - E_array[i_0001] = 0.25 * E_array[i_0001] / current_Ea; - } - for (i_0001 = 0; i_0001 < T_array.size(); i_0001 += 1) - { - T_array[i_0001] = 0.1 * T_array[i_0001] / current_Ta; - } - for (i_0001 = 0; i_0001 < E_prime_array.size(); i_0001 += 1) - { - E_prime_array[i_0001] = 0.25 * E_prime_array[i_0001] / current_Ea; - } - for (i_0001 = 0; i_0001 < T_prime_array.size(); i_0001 += 1) - { - T_prime_array[i_0001] = 0.1 * T_prime_array[i_0001] / current_Ta; - } - for (i_0001 = 0; i_0001 < f.size(); i_0001 += 1) - { - f[i_0001] = r[i_0001] * g_array[i_0001] / 5.0 / q(r[i_0001]); - } - for (i_0001 = 0; i_0001 < integ_contents.size(); i_0001 += 1) - { - integ_contents[i_0001] = r[i_0001] * (f[i_0001] * f[i_0001]) - 2 * (r[i_0001] * r[i_0001]) * 1.25663706212e-06 * dp(r[i_0001]) / (1.0 * 1.0); - } - Delta_prime_array[0] = 0; - Delta_array[0] = 0; - integral = 0.0; - for (i = 1; i < 1000 + 1; i += 1) - { - integral += dr * (integ_contents[i - 1] + integ_contents[i]) * 0.5; - Delta_prime_array[i] = (-integral) / (5.0 * r[i] * pow(f[i], 2.0)); - Delta_array[i] = Delta_array[i - 1] + dr * 0.5 * (Delta_prime_array[i - 1] + Delta_prime_array[i]); - } - current_Delta_a = Delta(1.0); - for (i_0001 = 0; i_0001 < Delta_array.size(); i_0001 += 1) - { - Delta_array[i_0001] -= current_Delta_a; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::x(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta) + Delta((r/Rmax)) - E((r/Rmax)) * cos(theta) - P((r/Rmax)) * cos(theta) + T((r/Rmax)) * cos(2.0 * theta) + 5.0; -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::x(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta) + Delta((r[i]/Rmax)) - E((r[i]/Rmax)) * cos(theta) - P((r[i]/Rmax)) * cos(theta) + T((r[i]/Rmax)) * cos(2.0 * theta) + 5.0; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::x(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i] + Delta((r/Rmax)) - E((r/Rmax)) * cos_theta[i] - P((r/Rmax)) * cos_theta[i] + T((r/Rmax)) * cos(2.0 * theta[i]) + 5.0; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::y(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (r/Rmax) * sin(theta) - E((r/Rmax)) * sin(theta) - P((r/Rmax)) * sin(theta) - T((r/Rmax)) * sin(2.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::y(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) - E((r[i]/Rmax)) * sin(theta) - P((r[i]/Rmax)) * sin(theta) - T((r[i]/Rmax)) * sin(2.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::y(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] - E((r/Rmax)) * sin_theta[i] - P((r/Rmax)) * sin_theta[i] - T((r/Rmax)) * sin(2.0 * theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_rr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (Delta_prime((r/Rmax)) - E_prime((r/Rmax)) * cos(theta) + T_prime((r/Rmax)) * cos(2.0 * theta) - dP((r/Rmax)) * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_rr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (Delta_prime((r[i]/Rmax)) - E_prime((r[i]/Rmax)) * cos(theta) + T_prime((r[i]/Rmax)) * cos(2.0 * theta) - dP((r[i]/Rmax)) * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_rr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (Delta_prime((r/Rmax)) - E_prime((r/Rmax)) * cos_theta[i] + T_prime((r/Rmax)) * cos(2.0 * theta[i]) - dP((r/Rmax)) * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_rt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (-(r/Rmax)) * sin(theta) + E((r/Rmax)) * sin(theta) + P((r/Rmax)) * sin(theta) - 2.0 * T((r/Rmax)) * sin(2.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_rt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r[i]/Rmax)) * sin(theta) + E((r[i]/Rmax)) * sin(theta) + P((r[i]/Rmax)) * sin(theta) - 2.0 * T((r[i]/Rmax)) * sin(2.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_rt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-(r/Rmax)) * sin_theta[i] + E((r/Rmax)) * sin_theta[i] + P((r/Rmax)) * sin_theta[i] - 2.0 * T((r/Rmax)) * sin(2.0 * theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_tr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-E_prime((r/Rmax))) * sin(theta) - T_prime((r/Rmax)) * sin(2.0 * theta) - dP((r/Rmax)) * sin(theta) + sin(theta))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_tr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r[i]/Rmax))) * sin(theta) - T_prime((r[i]/Rmax)) * sin(2.0 * theta) - dP((r[i]/Rmax)) * sin(theta) + sin(theta))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_tr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r/Rmax))) * sin_theta[i] - T_prime((r/Rmax)) * sin(2.0 * theta[i]) - dP((r/Rmax)) * sin_theta[i] + sin_theta[i])/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_tt(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return (r/Rmax) * cos(theta) - E((r/Rmax)) * cos(theta) - P((r/Rmax)) * cos(theta) - 2.0 * T((r/Rmax)) * cos(2.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_tt(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * cos(theta) - E((r[i]/Rmax)) * cos(theta) - P((r[i]/Rmax)) * cos(theta) - 2.0 * T((r[i]/Rmax)) * cos(2.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_tt(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * cos_theta[i] - E((r/Rmax)) * cos_theta[i] - P((r/Rmax)) * cos_theta[i] - 2.0 * T((r/Rmax)) * cos(2.0 * theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_xr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-(r/Rmax)) * cos(theta) + E((r/Rmax)) * cos(theta) + P((r/Rmax)) * cos(theta) + 2.0 * T((r/Rmax)) * cos(2.0 * theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_xr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r[i]/Rmax)) * cos(theta) + E((r[i]/Rmax)) * cos(theta) + P((r[i]/Rmax)) * cos(theta) + 2.0 * T((r[i]/Rmax)) * cos(2.0 * theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_xr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r/Rmax)) * cos_theta[i] + E((r/Rmax)) * cos_theta[i] + P((r/Rmax)) * cos_theta[i] + 2.0 * T((r/Rmax)) * cos(2.0 * theta[i])) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_xq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-(r/Rmax)) * sin(theta) + E((r/Rmax)) * sin(theta) + P((r/Rmax)) * sin(theta) - 2.0 * T((r/Rmax)) * sin(2.0 * theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_xq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r[i]/Rmax)) * sin(theta) + E((r[i]/Rmax)) * sin(theta) + P((r[i]/Rmax)) * sin(theta) - 2.0 * T((r[i]/Rmax)) * sin(2.0 * theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_xq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-(r/Rmax)) * sin_theta[i] + E((r/Rmax)) * sin_theta[i] + P((r/Rmax)) * sin_theta[i] - 2.0 * T((r/Rmax)) * sin(2.0 * theta[i])) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_yr(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-E_prime((r/Rmax))) * sin(theta) - T_prime((r/Rmax)) * sin(2.0 * theta) - dP((r/Rmax)) * sin(theta) + sin(theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_yr(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r[i]/Rmax))) * sin(theta) - T_prime((r[i]/Rmax)) * sin(2.0 * theta) - dP((r[i]/Rmax)) * sin(theta) + sin(theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_yr(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-E_prime((r/Rmax))) * sin_theta[i] - T_prime((r/Rmax)) * sin(2.0 * theta[i]) - dP((r/Rmax)) * sin_theta[i] + sin_theta[i]) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::J_yq(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-Delta_prime((r/Rmax))) + E_prime((r/Rmax)) * cos(theta) - T_prime((r/Rmax)) * cos(2.0 * theta) + dP((r/Rmax)) * cos(theta) - cos(theta)) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos(theta) + (r/Rmax) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) - (r/Rmax) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) + (r/Rmax) * dP((r/Rmax)) * pow(sin(theta), 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos(theta) + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos(theta) + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos(theta), 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + E((r/Rmax)) * pow(sin(theta), 2.0) + E((r/Rmax)) * pow(cos(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin(theta), 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * T_prime((r/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r/Rmax)) * T_prime((r/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin(theta), 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos(theta), 2.0) + P((r/Rmax)) * pow(sin(theta), 2.0) + P((r/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r/Rmax)) * cos(theta) * cos(2.0 * theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_yq(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-Delta_prime((r[i]/Rmax))) + E_prime((r[i]/Rmax)) * cos(theta) - T_prime((r[i]/Rmax)) * cos(2.0 * theta) + dP((r[i]/Rmax)) * cos(theta) - cos(theta)) / ((-(r[i]/Rmax)) * Delta_prime((r[i]/Rmax)) * cos(theta) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) + (r[i]/Rmax) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - (r[i]/Rmax) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) + (r[i]/Rmax) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0) + Delta_prime((r[i]/Rmax)) * E((r[i]/Rmax)) * cos(theta) + Delta_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * cos(theta) + 2.0 * Delta_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(2.0 * theta) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * E_prime((r[i]/Rmax)) * pow(cos(theta), 2.0) - E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + E((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - E((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + E((r[i]/Rmax)) * pow(sin(theta), 2.0) + E((r[i]/Rmax)) * pow(cos(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(sin(theta), 2.0) - E_prime((r[i]/Rmax)) * P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * E_prime((r[i]/Rmax)) * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + P((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(sin(theta), 2.0) - P((r[i]/Rmax)) * dP((r[i]/Rmax)) * pow(cos(theta), 2.0) + P((r[i]/Rmax)) * pow(sin(theta), 2.0) + P((r[i]/Rmax)) * pow(cos(theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(sin(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * T_prime((r[i]/Rmax)) * pow(cos(2.0 * theta), 2.0) + 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * dP((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta) - 2.0 * T((r[i]/Rmax)) * sin(theta) * sin(2.0 * theta) + 2.0 * T((r[i]/Rmax)) * cos(theta) * cos(2.0 * theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::J_yq(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-Delta_prime((r/Rmax))) + E_prime((r/Rmax)) * cos_theta[i] - T_prime((r/Rmax)) * cos(2.0 * theta[i]) + dP((r/Rmax)) * cos_theta[i] - cos_theta[i]) / ((-(r/Rmax)) * Delta_prime((r/Rmax)) * cos_theta[i] + (r/Rmax) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) + (r/Rmax) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - (r/Rmax) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) + (r/Rmax) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) + (r/Rmax) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0) + Delta_prime((r/Rmax)) * E((r/Rmax)) * cos_theta[i] + Delta_prime((r/Rmax)) * P((r/Rmax)) * cos_theta[i] + 2.0 * Delta_prime((r/Rmax)) * T((r/Rmax)) * cos(2.0 * theta[i]) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * E_prime((r/Rmax)) * pow(cos_theta[i], 2.0) - E((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + E((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - E((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - E((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + E((r/Rmax)) * pow(sin_theta[i], 2.0) + E((r/Rmax)) * pow(cos_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(sin_theta[i], 2.0) - E_prime((r/Rmax)) * P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * E_prime((r/Rmax)) * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * T_prime((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + P((r/Rmax)) * T_prime((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - P((r/Rmax)) * dP((r/Rmax)) * pow(sin_theta[i], 2.0) - P((r/Rmax)) * dP((r/Rmax)) * pow(cos_theta[i], 2.0) + P((r/Rmax)) * pow(sin_theta[i], 2.0) + P((r/Rmax)) * pow(cos_theta[i], 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(sin(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * T_prime((r/Rmax)) * pow(cos(2.0 * theta[i]), 2.0) + 2.0 * T((r/Rmax)) * dP((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * dP((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i]) - 2.0 * T((r/Rmax)) * sin_theta[i] * sin(2.0 * theta[i]) + 2.0 * T((r/Rmax)) * cos_theta[i] * cos(2.0 * theta[i])); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::coeffs2(double r, double Rmax) const -{ - return 1.0 * exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::rho_glob(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::rho_glob(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::rho_glob(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::rho_pole(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::rho_pole(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::rho_pole(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedCulham::phi_exact(double r, double theta, double map3_unused_1, double map3_unused_2, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::phi_exact(std::vector const& r, double theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedCulham::phi_exact(double r, std::vector const& theta, double map3_unused_1, double map3_unused_2, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ diff --git a/src/test_cases/RefinedGyroZoniShiftedShafranov.cpp b/src/test_cases/RefinedGyroZoniShiftedShafranov.cpp deleted file mode 100644 index 6966f995..00000000 --- a/src/test_cases/RefinedGyroZoniShiftedShafranov.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "RefinedGyroZoniShiftedShafranov.h" -#include -#include - - -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::x(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos(theta) + (r/Rmax) * cos(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::x(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r[i]/Rmax) * (r[i]/Rmax)) - map1_kappa * (r[i]/Rmax) * cos(theta) + (r[i]/Rmax) * cos(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::x(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-map1_delta) * ((r/Rmax) * (r/Rmax)) - map1_kappa * (r/Rmax) * cos_theta[i] + (r/Rmax) * cos_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::y(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return map1_kappa * (r/Rmax) * sin(theta) + (r/Rmax) * sin(theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::y(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r[i]/Rmax) * sin(theta) + (r[i]/Rmax) * sin(theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::y(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map1_kappa * (r/Rmax) * sin_theta[i] + (r/Rmax) * sin_theta[i]; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_rr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_rr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_rr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i])/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_rt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * sin(theta) - sin(theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_rt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * sin(theta) - sin(theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_rt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * sin_theta[i] - sin_theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_tr(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((map1_kappa + 1.0) * sin(theta))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_tr(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin(theta))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_tr(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((map1_kappa + 1.0) * sin_theta[i])/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_tt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (r/Rmax) * (map1_kappa * cos(theta) + cos(theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_tt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * (map1_kappa * cos(theta) + cos(theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_tt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * (map1_kappa * cos_theta[i] + cos_theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_xs(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (-cos(theta)) / (2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_xs(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos(theta)) / (2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * pow(sin(theta), 2.0) + map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_xs(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (-cos_theta[i]) / (2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_xt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos(theta) + 2.0 * map1_delta * (r/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_xt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin(theta) - sin(theta)) / (2.0 * map1_delta * map1_kappa * (r[i]/Rmax) * cos(theta) + 2.0 * map1_delta * (r[i]/Rmax) * cos(theta) + map1_kappa * map1_kappa * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * pow(cos(theta), 2.0) - pow(sin(theta), 2.0) - pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_xt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map1_kappa * sin_theta[i] - sin_theta[i]) / (2.0 * map1_delta * map1_kappa * (r/Rmax) * cos_theta[i] + 2.0 * map1_delta * (r/Rmax) * cos_theta[i] + map1_kappa * map1_kappa * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * pow(cos_theta[i], 2.0) - pow(sin_theta[i], 2.0) - pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_ys(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return sin(theta) / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_ys(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin(theta) / (2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_ys(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = sin_theta[i] / (2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::J_yt(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos(theta), 2.0) - (r/Rmax) * pow(sin(theta), 2.0) - (r/Rmax) * pow(cos(theta), 2.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_yt(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r[i]/Rmax) + map1_kappa * cos(theta) - cos(theta)) / (2.0 * map1_delta * map1_kappa * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 2.0 * map1_delta * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(sin(theta), 2.0) + map1_kappa * map1_kappa * (r[i]/Rmax) * pow(cos(theta), 2.0) - (r[i]/Rmax) * pow(sin(theta), 2.0) - (r[i]/Rmax) * pow(cos(theta), 2.0)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::J_yt(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (2.0 * map1_delta * (r/Rmax) + map1_kappa * cos_theta[i] - cos_theta[i]) / (2.0 * map1_delta * map1_kappa * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 2.0 * map1_delta * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + map1_kappa * map1_kappa * (r/Rmax) * pow(sin_theta[i], 2.0) + map1_kappa * map1_kappa * (r/Rmax) * pow(cos_theta[i], 2.0) - (r/Rmax) * pow(sin_theta[i], 2.0) - (r/Rmax) * pow(cos_theta[i], 2.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::rho_glob(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 1.0 * (((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) - (2.0 * map1_delta * (map1_kappa - 1.0) * ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((10000.0 * pow((0.45 - (r/Rmax)), 2.0) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta) + (44444444.4444444 * pow((0.9 - (r/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-21.0) * ((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - ((1.40205987405332e-13 * (r/Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) + ((-0.0331692070000574) * (r/Rmax) - 9.0 * (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.0162264454441452) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (21.0 * (7.0102993702666e-14 * ((r/Rmax) * (r/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + 9.0 * ((-0.0165846035000287) * ((r/Rmax) * (r/Rmax)) + 0.0162264454441452 * (r/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::rho_glob(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * (((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) - (2.0 * map1_delta * (map1_kappa - 1.0) * ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) * sin(theta) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (r[i]/Rmax) * (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (r[i]/Rmax) * ((10000.0 * pow((0.45 - (r[i]/Rmax)), 2.0) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta) + (44444444.4444444 * pow((0.9 - (r[i]/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-21.0) * ((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) + (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) - ((1.40205987405332e-13 * (r[i]/Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) + ((-0.0331692070000574) * (r[i]/Rmax) - 9.0 * (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) + 0.0162264454441452) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * sin(theta) + 2.0 * map1_delta * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * sin(theta) * cos(theta) - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin(theta), 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * cos(theta) + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / ((r[i]/Rmax) * pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)), (3.0 / 2.0))) + (pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (21.0 * (7.0102993702666e-14 * ((r[i]/Rmax) * (r[i]/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + 9.0 * ((-0.0165846035000287) * ((r[i]/Rmax) * (r[i]/Rmax)) + 0.0162264454441452 * (r[i]/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta)) * ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0)))) / ((r[i]/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin(theta), 2.0) + pow(((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin(theta), 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r[i]/Rmax) - map1_kappa * cos(theta) + cos(theta)) * sin(theta) + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta)), 2.0))); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::rho_glob(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * (((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i])) * exp(tanh(20.0 * (r/Rmax) - 14.0)) - (2.0 * map1_delta * (map1_kappa - 1.0) * ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) * sin_theta[i] / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (r/Rmax) * ((10000.0 * pow((0.45 - (r/Rmax)), 2.0) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]) + (44444444.4444444 * pow((0.9 - (r/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-21.0) * ((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * sin(9.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) + (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) - ((1.40205987405332e-13 * (r/Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) + ((-0.0331692070000574) * (r/Rmax) - 9.0 * (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.0162264454441452) * sin(9.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * ((-2.0) * map1_delta * (map1_kappa - 1.0) * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * sin_theta[i] + 2.0 * map1_delta * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0)) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * (4.0 * map1_kappa * (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * sin_theta[i] * cos_theta[i] - 1.0 / 2.0 * (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) + 1.0 / 2.0 * ((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])) * (2.0 * pow((map1_kappa - 1.0), 2.0) * pow(sin_theta[i], 2.0) + 2.0 * (map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * cos_theta[i] + 2.0 * pow((map1_kappa + 1.0), 2.0) * cos(2.0 * theta[i]))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * pow(((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)), (3.0 / 2.0))) + (pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (21.0 * (7.0102993702666e-14 * ((r/Rmax) * (r/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + 9.0 * ((-0.0165846035000287) * ((r/Rmax) * (r/Rmax)) + 0.0162264454441452 * (r/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))) + (pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i]) + (2.0 * map1_kappa - 2.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i]) * ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0)))) / ((r/Rmax) * sqrt((pow((map1_kappa + 1.0), 2.0) * pow(sin_theta[i], 2.0) + pow(((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]), 2.0)) * (map1_kappa * map1_kappa - 4.0 * map1_kappa * pow(sin_theta[i], 2.0) + 2.0 * map1_kappa + 1.0) - pow(((map1_kappa - 1.0) * ((-2.0) * map1_delta * (r/Rmax) - map1_kappa * cos_theta[i] + cos_theta[i]) * sin_theta[i] + 1.0 / 2.0 * pow((map1_kappa + 1.0), 2.0) * sin(2.0 * theta[i])), 2.0))); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::rho_pole(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::rho_pole(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::rho_pole(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::coeffs2(double r, double Rmax) const -{ - return 1.0 * exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedShafranov::phi_exact(double r, double theta, double map1_kappa, double map1_delta, double Rmax) const -{ - return ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::phi_exact(std::vector const& r, double theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedShafranov::phi_exact(double r, std::vector const& theta, double map1_kappa, double map1_delta, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/test_cases/RefinedGyroZoniShiftedTriangular.cpp b/src/test_cases/RefinedGyroZoniShiftedTriangular.cpp deleted file mode 100644 index 0f2d14cf..00000000 --- a/src/test_cases/RefinedGyroZoniShiftedTriangular.cpp +++ /dev/null @@ -1,305 +0,0 @@ -#include "RefinedGyroZoniShiftedTriangular.h" -#include -#include - - -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::x(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::x(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::x(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (1.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) / map2_epsilon; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::y(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return map2_e * (r/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::y(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r[i]/Rmax) * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::y(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = map2_e * (r/Rmax) * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_rr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_rr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos(theta)) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_rr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-cos_theta[i]) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_rt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_rt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * sin(theta) / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_rt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * sin_theta[i] / sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_tr(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))/Rmax; -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_tr(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))/Rmax; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_tr(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))/Rmax; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_tt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_tt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r[i]/Rmax) * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_tt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (r/Rmax) * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_xs(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_xs(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin(theta), 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 6.0 * pow(map2_epsilon, 5.0) * (r[i]/Rmax) * cos(theta) + 8.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin(theta), 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(sin(theta), 2.0) * pow(cos(theta), 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 94.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 108.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * cos(theta) - 20.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * pow(cos(theta), 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin(theta), 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) * cos(theta) + 96.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 121.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) - 134.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(sin(theta), 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 41.0 * pow(sin(theta), 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 8.0 * pow(map2_epsilon, 4.0) * cos(theta) + 4.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * pow(cos(theta), 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(cos(theta), 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 48.0 * (map2_epsilon * map2_epsilon) * cos(theta) + 52.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * pow(cos(theta), 2.0) - 96.0 * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) - 40.0 * cos(theta)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_xs(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 6.0) * pow(sin_theta[i], 2.0) - pow(map2_epsilon, 6.0) + 5.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 6.0 * pow(map2_epsilon, 5.0) * (r/Rmax) * cos_theta[i] + 8.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 12.0 * pow(map2_epsilon, 4.0) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 8.0 * pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 27.0 * pow(map2_epsilon, 4.0) * pow(sin_theta[i], 2.0) - 27.0 * pow(map2_epsilon, 4.0) + 4.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 3.0) - 8.0 * pow(map2_epsilon, 3.0) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 3.0) - 26.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 94.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 108.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * cos_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) + 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) + 80.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * pow(cos_theta[i], 2.0) - 108.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 2.0) - 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 48.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 67.0 * (map2_epsilon * map2_epsilon) * pow(sin_theta[i], 2.0) - 67.0 * (map2_epsilon * map2_epsilon) - 82.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) * cos_theta[i] + 96.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 121.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] - 134.0 * map2_epsilon * (r/Rmax) * cos_theta[i] - 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(sin_theta[i], 2.0) + 40.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 41.0 * pow(sin_theta[i], 2.0) - 41.0) / (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 8.0 * pow(map2_epsilon, 4.0) * cos_theta[i] + 4.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 32.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * pow(cos_theta[i], 2.0) + 4.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 3.0) - 32.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(cos_theta[i], 3.0) + 26.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 48.0 * (map2_epsilon * map2_epsilon) * cos_theta[i] + 52.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * pow(cos_theta[i], 2.0) - 96.0 * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) + 41.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] - 40.0 * cos_theta[i]); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_xt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_xt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) - 2.0 * map2_epsilon * (r[i]/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin(theta)) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_xt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-(map2_epsilon * map2_epsilon)) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] - 2.0 * map2_epsilon * (r/Rmax) * sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i] * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - sqrt(4.0 - map2_epsilon * map2_epsilon) * sin_theta[i]) / (map2_e * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_ys(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos(theta) - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) + 13.0 * (r/Rmax)); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_ys(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 6.0 * pow(map2_epsilon, 4.0) * sin(theta) + 3.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 20.0 * pow(map2_epsilon, 3.0) * (r[i]/Rmax) * sin(theta) * cos(theta) + 2.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * pow(cos(theta), 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * sin(theta) * pow(cos(theta), 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 20.0 * (map2_epsilon * map2_epsilon) * sin(theta) + 23.0 * map2_epsilon * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) * cos(theta) - 36.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * sin(theta) - 14.0 * sin(theta)) / (pow(map2_epsilon, 4.0) * (r[i]/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) + 4.0 * (map2_epsilon * map2_epsilon) * pow((r[i]/Rmax), 3.0) * pow(cos(theta), 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) - 12.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 28.0 * map2_epsilon * ((r[i]/Rmax) * (r[i]/Rmax)) * cos(theta) - 14.0 * (r[i]/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) + 13.0 * (r[i]/Rmax)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_ys(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = (pow(map2_epsilon, 4.0) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 6.0 * pow(map2_epsilon, 4.0) * sin_theta[i] + 3.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 20.0 * pow(map2_epsilon, 3.0) * (r/Rmax) * sin_theta[i] * cos_theta[i] + 2.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * pow(cos_theta[i], 2.0) - 16.0 * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * sin_theta[i] * pow(cos_theta[i], 2.0) + 14.0 * (map2_epsilon * map2_epsilon) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 20.0 * (map2_epsilon * map2_epsilon) * sin_theta[i] + 23.0 * map2_epsilon * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] * cos_theta[i] - 36.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] + 13.0 * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * sin_theta[i] - 14.0 * sin_theta[i]) / (pow(map2_epsilon, 4.0) * (r/Rmax) + 4.0 * pow(map2_epsilon, 3.0) * ((r/Rmax) * (r/Rmax)) * cos_theta[i] + 4.0 * (map2_epsilon * map2_epsilon) * pow((r/Rmax), 3.0) * pow(cos_theta[i], 2.0) - 6.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 14.0 * (map2_epsilon * map2_epsilon) * (r/Rmax) - 12.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 28.0 * map2_epsilon * ((r/Rmax) * (r/Rmax)) * cos_theta[i] - 14.0 * (r/Rmax) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) + 13.0 * (r/Rmax)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::J_yt(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r/Rmax)); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_yt(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r[i]/Rmax) * cos(theta) + 1.0) * cos(theta) + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos(theta)) / (map2_e * (r[i]/Rmax)); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::J_yt(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 / 2.0 * ((-sqrt(4.0 - map2_epsilon * map2_epsilon)) * sqrt(map2_epsilon * map2_epsilon + 2.0 * map2_epsilon * (r/Rmax) * cos_theta[i] + 1.0) * cos_theta[i] + 2.0 * sqrt(4.0 - map2_epsilon * map2_epsilon) * cos_theta[i]) / (map2_e * (r/Rmax)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::rho_glob(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 1.0 * (((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(tanh(20.0 * (r/Rmax) - 14.0)) - ((r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (r/Rmax) * ((10000.0 * pow((0.45 - (r/Rmax)), 2.0) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta) + (44444444.4444444 * pow((0.9 - (r/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-21.0) * ((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((1.40205987405332e-13 * (r/Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) + ((-0.0331692070000574) * (r/Rmax) - 9.0 * (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.0162264454441452) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) + ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0))) + (21.0 * (7.0102993702666e-14 * ((r/Rmax) * (r/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + 9.0 * ((-0.0165846035000287) * ((r/Rmax) * (r/Rmax)) + 0.0162264454441452 * (r/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos(theta)) + 1.0)))); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::rho_glob(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * (((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)) - ((r[i]/Rmax) * (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (r[i]/Rmax) * (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (r[i]/Rmax) * ((10000.0 * pow((0.45 - (r[i]/Rmax)), 2.0) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta) + (44444444.4444444 * pow((0.9 - (r[i]/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-21.0) * ((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) + (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - (((-6.67647559073009e-15) * (r[i]/Rmax) + (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00368546744445083 * (r[i]/Rmax) + (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta)) * ((-2.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((1.40205987405332e-13 * (r[i]/Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r[i]/Rmax)) * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) + ((-0.0331692070000574) * (r[i]/Rmax) - 9.0 * (45.0 - 100.0 * (r[i]/Rmax)) * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0)) + 0.0162264454441452) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (20.0 * pow(tanh(20.0 * (r[i]/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) - ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (4.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (2.0 * map2_epsilon * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * map2_epsilon * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) + ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + ((-21.0) * ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * sin(21.0 * theta) - 9.0 * (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * sin(9.0 * theta)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * ((-4.0) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) * cos(theta) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0) - 2.0 * pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * sin(theta) * pow(cos(theta), 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 2.0) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r[i]/Rmax) * pow(cos(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + 2.0 * map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (2.0 * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r[i]/Rmax) * (r[i]/Rmax)) * pow(sin(theta), 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) - 2.0 * map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) + 2.0 * sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / ((r[i]/Rmax) * pow(((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))), (3.0 / 2.0))) + (21.0 * (7.0102993702666e-14 * ((r[i]/Rmax) * (r[i]/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + 9.0 * ((-0.0165846035000287) * ((r[i]/Rmax) * (r[i]/Rmax)) + 0.0162264454441452 * (r[i]/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0))))) / ((r[i]/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) * (map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))) - sin(theta) * cos(theta) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r[i]/Rmax) * pow(sin(theta), 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(sin(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) * (pow((map2_e * map2_epsilon * (r[i]/Rmax) * sin(theta) * cos(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)) + map2_e * sin(theta) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))), 2.0) + pow(cos(theta), 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r[i]/Rmax) * cos(theta)) + 1.0)))); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::rho_glob(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * (((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i])) * exp(tanh(20.0 * (r/Rmax) - 14.0)) - ((r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (r/Rmax) * (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (r/Rmax) * ((10000.0 * pow((0.45 - (r/Rmax)), 2.0) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.00368546744445083 - 100.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]) + (44444444.4444444 * pow((0.9 - (r/Rmax)), 2.0) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0)) - 6.67647559073009e-15 - 6666.66666666667 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-21.0) * ((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * sin(9.0 * theta[i])) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) + (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - (((-6.67647559073009e-15) * (r/Rmax) + (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00368546744445083 * (r/Rmax) + (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) - 0.0018029383826828) * cos(9.0 * theta[i])) * ((-2.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((1.40205987405332e-13 * (r/Rmax) - 21.0 * (6000.0 - 6666.66666666667 * (r/Rmax)) * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) + ((-0.0331692070000574) * (r/Rmax) - 9.0 * (45.0 - 100.0 * (r/Rmax)) * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0)) + 0.0162264454441452) * sin(9.0 * theta[i])) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (20.0 * pow(tanh(20.0 * (r/Rmax) - 14.0), 2.0) - 20.0) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (4.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(cos_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 4.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * ((-2.0) * map2_epsilon * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0)) - ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * (2.0 * map2_epsilon * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * map2_epsilon * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) + ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + ((-21.0) * ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * sin(21.0 * theta[i]) - 9.0 * (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * sin(9.0 * theta[i])) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (1.0 / 2.0 * (((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * ((-4.0) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) * cos_theta[i] / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + 2.0 * ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-map2_e) * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 3.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0) - 2.0 * pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * sin_theta[i] * pow(cos_theta[i], 2.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (2.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) - 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 2.0) * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 4.0 * map2_e * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * map2_epsilon * (r/Rmax) * pow(cos_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + 2.0 * map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 1.0 / 2.0 * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (2.0 * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 3.0) / pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), 2.0) + ((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * ((-2.0) * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * pow((map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0), (3.0 / 2.0))) + 4.0 * map2_e * (map2_epsilon * map2_epsilon) * ((r/Rmax) * (r/Rmax)) * pow(sin_theta[i], 3.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 3.0) * (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 6.0 * map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) - 2.0 * map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) + 2.0 * sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * pow(((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))), (3.0 / 2.0))) + (21.0 * (7.0102993702666e-14 * ((r/Rmax) * (r/Rmax)) - 21.0 * exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + 9.0 * ((-0.0165846035000287) * ((r/Rmax) * (r/Rmax)) + 0.0162264454441452 * (r/Rmax) + 0.00036058767653656 - 9.0 * exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i])) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * exp(-tanh(20.0 * (r/Rmax) - 14.0)) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0))))) / ((r/Rmax) * sqrt((-pow((((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) * (map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))) - sin_theta[i] * cos_theta[i] / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0)) + (pow(((-map2_e) * map2_epsilon * (r/Rmax) * pow(sin_theta[i], 2.0) / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(sin_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) * (pow((map2_e * map2_epsilon * (r/Rmax) * sin_theta[i] * cos_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * pow((2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)), 2.0) * sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)) + map2_e * sin_theta[i] / (sqrt(1.0 - 1.0 / 4.0 * (map2_epsilon * map2_epsilon)) * (2.0 - sqrt(map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))), 2.0) + pow(cos_theta[i], 2.0) / (map2_epsilon * (map2_epsilon + 2.0 * (r/Rmax) * cos_theta[i]) + 1.0)))); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::rho_pole(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return 0.0; -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::rho_pole(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::rho_pole(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 0.0; - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::coeffs1(double r, double Rmax) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - return exp(-tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::coeffs1(std::vector const& r, double Rmax, std::vector& sol) const -{ // With Rmax=1, equals alpha(r) from equation (18) of Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249 - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = exp(-tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::coeffs2(double r, double Rmax) const -{ - return 1.0 * exp(tanh(20.0 * (r/Rmax) - 14.0)); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::coeffs2(std::vector const& r, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = 1.0 * exp(tanh(20.0 * (r[i]/Rmax) - 14.0)); - } -} -/*........................................*/ -double RefinedGyroZoniShiftedTriangular::phi_exact(double r, double theta, double map2_epsilon, double map2_e, double Rmax) const -{ - return ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::phi_exact(std::vector const& r, double theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0 * (r[i]/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r[i]/Rmax) - 0.9), 2.0))) * cos(21.0 * theta) + (0.00184273372222541 * ((r[i]/Rmax) * (r[i]/Rmax)) - 0.0018029383826828 * (r[i]/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r[i]/Rmax) - 0.45), 2.0))) * cos(9.0 * theta); - } -} -/*........................................*/ -void RefinedGyroZoniShiftedTriangular::phi_exact(double r, std::vector const& theta, double map2_epsilon, double map2_e, double Rmax, std::vector& sol, std::vector& sin_theta, std::vector& cos_theta) const -{ - for (std::size_t i=0; i < sol.size(); ++i) - { - sol[i] = ((-3.33823779536505e-15) * ((r/Rmax) * (r/Rmax)) - 0.0 * (r/Rmax) - 0.0 + exp((-3333.33333333333) * pow(((r/Rmax) - 0.9), 2.0))) * cos(21.0 * theta[i]) + (0.00184273372222541 * ((r/Rmax) * (r/Rmax)) - 0.0018029383826828 * (r/Rmax) - 4.00652973929511e-05 + exp((-50.0) * pow(((r/Rmax) - 0.45), 2.0))) * cos(9.0 * theta[i]); - } -} -/*........................................*/ diff --git a/src/weak_scaling.cpp b/src/weak_scaling.cpp new file mode 100644 index 00000000..aae82877 --- /dev/null +++ b/src/weak_scaling.cpp @@ -0,0 +1,185 @@ +#include +#include +#include +#include +#include +#include + +#include "../include/GMGPolar/gmgpolar.h" +#include "../include/GMGPolar/test_cases.h" + +void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) +{ + const double R0 = 1e-8; + const double Rmax = 1.3; + const double inverse_aspect_ratio_epsilon = 0.3; + const double ellipticity_e = 1.4; + const double elongation_kappa = 0.3; + const double shift_delta = 0.2; + + /* Example 1: Polar Solution -> Higher Order 4.0 */ + // const double alpha_jump = 0.4837 * Rmax; + // std::unique_ptr domain_geometry = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr exact_solution = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + // std::unique_ptr boundary_conditions = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr source_term = std::make_unique(Rmax, elongation_kappa, shift_delta); + + /* Example 2: Cartesian Solution -> Lower Order 3.5 */ + const double alpha_jump = 0.66 * Rmax; + std::unique_ptr domain_geometry = + std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + std::unique_ptr exact_solution = + std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + std::unique_ptr source_term = std::make_unique( + Rmax, inverse_aspect_ratio_epsilon, ellipticity_e); + + /* Example 3: Refined Solution -> Lower Order 3.5 */ + // const double alpha_jump = 0.9 * Rmax; // Refinement where the solution is most complex + // std::unique_ptr domain_geometry = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr exact_solution = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + // std::unique_ptr boundary_conditions = std::make_unique(Rmax, elongation_kappa, shift_delta); + // std::unique_ptr source_term = std::make_unique(Rmax, elongation_kappa, shift_delta); + + std::string geometry_string = ""; + if (typeid(*domain_geometry) == typeid(CircularGeometry)) { + geometry_string = "Circular"; + } + else if (typeid(*domain_geometry) == typeid(ShafranovGeometry)) { + geometry_string = "Shafranov"; + } + else if (typeid(*domain_geometry) == typeid(CzarnyGeometry)) { + geometry_string = "Czarny"; + } + else if (typeid(*domain_geometry) == typeid(CulhamGeometry)) { + geometry_string = "Culham"; + } + else { + geometry_string = "Unknown"; + } + + GMGPolar solver(std::move(domain_geometry), std::move(coefficients), std::move(boundary_conditions), + std::move(source_term)); + + solver.setSolution(std::move(exact_solution)); + + const int verbose = 1; + const bool paraview = false; + + const double threadReductionFactor = 1.0; + + const StencilDistributionMethod stencilDistributionMethod = StencilDistributionMethod::CPU_GIVE; + const bool cacheDensityProfileCoefficients = true; + const bool cacheDomainGeometry = false; + + const int nr_exp = 4; + const int ntheta_exp = 6; + const int anisotropic_factor = 3; + + const bool DirBC_Interior = false; + + const bool FMG = true; + const int FMG_iterations = 3; + const MultigridCycleType FMG_cycle = MultigridCycleType::F_CYCLE; + + const ExtrapolationType extrapolation = ExtrapolationType::IMPLICIT_EXTRAPOLATION; + const int maxLevels = 7; + const int preSmoothingSteps = 1; + const int postSmoothingSteps = 1; + const MultigridCycleType multigridCycle = MultigridCycleType::F_CYCLE; + + const int maxIterations = 10; + const ResidualNormType residualNormType = ResidualNormType::EUCLIDEAN; + const double absoluteTolerance = 1e-50; + const double relativeTolerance = 1e-50; + + solver.verbose(verbose); + solver.paraview(paraview); + + solver.maxOpenMPThreads(maxOpenMPThreads); + solver.threadReductionFactor(threadReductionFactor); + + solver.stencilDistributionMethod(stencilDistributionMethod); + solver.cacheDensityProfileCoefficients(cacheDensityProfileCoefficients); + solver.cacheDomainGeometry(cacheDomainGeometry); + + solver.R0(R0); + solver.Rmax(Rmax); + solver.nr_exp(nr_exp); + solver.ntheta_exp(ntheta_exp); + solver.anisotropic_factor(anisotropic_factor); + solver.divideBy2(divideBy2); + + solver.DirBC_Interior(DirBC_Interior); + + solver.FMG(FMG); + solver.FMG_iterations(FMG_iterations); + solver.FMG_cycle(FMG_cycle); + + solver.extrapolation(extrapolation); + solver.maxLevels(maxLevels); + solver.preSmoothingSteps(preSmoothingSteps); + solver.postSmoothingSteps(postSmoothingSteps); + solver.multigridCycle(multigridCycle); + + solver.maxIterations(maxIterations); + solver.residualNormType(residualNormType); + solver.absoluteTolerance(absoluteTolerance); + solver.relativeTolerance(relativeTolerance); + + // Perform setup and solve + solver.setup(); + solver.solve(); + + std::string stencil_string = ""; + if (solver.stencilDistributionMethod() == StencilDistributionMethod::CPU_TAKE) { + stencil_string = "Take"; + } + else if (solver.stencilDistributionMethod() == StencilDistributionMethod::CPU_GIVE) { + stencil_string = "Give"; + } + + int extrapolation_int = static_cast(solver.extrapolation()); + + // Write results to file + outfile << maxOpenMPThreads << "," << divideBy2 << "," << solver.grid().nr() << "," << solver.grid().ntheta() << "," + << geometry_string << "," << stencil_string << "," << cacheDensityProfileCoefficients << "," + << cacheDomainGeometry << "," << FMG << "," << extrapolation_int << "," + << solver.t_setup_total + solver.t_solve_total - solver.t_setup_rhs << "," + << solver.t_setup_total - solver.t_setup_rhs << "," << solver.t_setup_createLevels << "," + << solver.t_setup_smoother << "," << solver.t_setup_directSolver << "," << solver.t_solve_total << "," + << solver.t_solve_initial_approximation << "," << solver.t_solve_multigrid_iterations << "," + << solver.t_check_convergence << "," << solver.t_check_exact_error << "," << solver.t_avg_MGC_total << "," + << solver.t_avg_MGC_preSmoothing << "," << solver.t_avg_MGC_postSmoothing << "," + << solver.t_avg_MGC_residual << "," << solver.t_avg_MGC_directSolver << std::endl; +} + +int main() +{ + std::ofstream outfile("weak_scaling_results.csv"); + outfile << "Threads,DivideBy2,nr,ntheta,geometry," + << "stencil_method,cacheDensityProfileCoefficients,cacheDomainGeometry,FMG,extrapolation_int," + << "TotalTime,t_setup_total,t_setup_createLevels," + << "t_setup_smoother,t_setup_directSolver,t_solve_total,t_solve_initial_approximation," + << "t_solve_multigrid_iterations,t_check_convergence,t_check_exact_error," + << "t_avg_MGC_total,t_avg_MGC_preSmoothing,t_avg_MGC_postSmoothing," + << "t_avg_MGC_residual,t_avg_MGC_directSolver\n"; // Header + + // Define the parameters for testing + std::vector threadCounts = {1, 4, 16, 56}; + std::vector divideCounts = {5, 6, 7, 8}; + + for (size_t i = 0; i < threadCounts.size(); i++) { + runTest(threadCounts[i], divideCounts[i], outfile); + } + + outfile.close(); + std::cout << "Results written to weak_scaling_results.csv" << std::endl; + + return 0; +} diff --git a/src/write_arrays_to_file.cpp_archive b/src/write_arrays_to_file.cpp_archive deleted file mode 100644 index 890cc540..00000000 --- a/src/write_arrays_to_file.cpp_archive +++ /dev/null @@ -1,101 +0,0 @@ -// utils::disp(fVec, "RHS"); -// std::ofstream myfile; -// // myfile.open("RHS.txt", std::ios_base::app); -// myfile.open("RHS.txt"); -// if (myfile.is_open()) { -// for (int i=0; i + +#include +#include + +#include "../../include/GMGPolar/gmgpolar.h" + +#include "../../include/Residual/ResidualGive/residualGive.h" +#include "../../include/DirectSolver/DirectSolverGive/directSolverGive.h" +#include "../../include/DirectSolver/DirectSolverTake/directSolverTake.h" +#include "../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" +#include "../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" + +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" +#include "../../include/InputFunctions/boundaryConditions.h" +#include "../../include/InputFunctions/sourceTerm.h" +/* ------ */ +/* Test 1 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/circularGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h" +/* ------ */ +/* Test 2 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/shafranovGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h" +/* ------ */ +/* Test 3 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" +/* ------ */ +/* Test 4 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/culhamGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h" +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h" + +namespace DirectSolverTest +{ +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); + std::uniform_real_distribution dist(-100.0, 100.0); + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace DirectSolverTest + +using namespace DirectSolverTest; + +#ifdef GMGPOLAR_USE_MUMPS + +/* Test 1/2: */ +/* Does the Take and Give Implementation match up? */ + +TEST(DirectSolverTest, directSolver_DirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); + + DirectSolverTake directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + DirectSolverGive directSolverTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + + Vector solution_Give = rhs; + directSolverGive_operator.solveInPlace(solution_Give); + + Vector solution_Take = rhs; + directSolverTake_operator.solveInPlace(solution_Take); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + } +} + +TEST(DirectSolverTest, directSolver_AcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + DirectSolverTake directSolverTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + + Vector solution_Give = rhs; + directSolverGive_operator.solveInPlace(solution_Give); + + Vector solution_Take = rhs; + directSolverTake_operator.solveInPlace(solution_Take); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-8); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-9); + } +} + +/* Test 2/2: */ +/* Are the DirectSolver and Residual are compatible with each other? */ + +/* -------- */ +/* Circular */ +/* -------- */ + +TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +TEST(DirectSolverTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* --------- */ +/* Shafranov */ +/* --------- */ + +TEST(DirectSolverTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Czarny */ +/* ------ */ + +TEST(DirectSolverTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Culham */ +/* ------ */ + +TEST(DirectSolverTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-7); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* We adjust the PolarGrid to increase the precision */ + +TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_CircularGeometry) +{ + std::vector radii = {1e-5, 1.441 * 1e-5, + 3.8833 * 1e-5, 8.7666 * 1e-5, + 1.8533 * 1e-4, 3.806 * 1e-4, + 7.713 * 1e-4, 1.55265 * 1e-3, + 3.1153 * 1e-3, 6.2406 * 1e-3, + 0.01249125, 0.0249925, + 0.049995, 0.1, + 0.2, 0.25, + 0.5, 0.8, + 0.9, 0.95, + 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-9); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-10); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-10); +} + +TEST(DirectSolverTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2_CircularGeometry) +{ + std::vector radii = {0.15, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGive solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +/* Same test now using Take */ + +TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +TEST(DirectSolverTakeTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* --------- */ +/* Shafranov */ +/* --------- */ + +TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Czarny */ +/* ------ */ + +TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Culham */ +/* ------ */ + +TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-11); +} + +TEST(DirectSolverTakeTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-7); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_CircularGeometry) +{ + std::vector radii = {1e-5, 1.441 * 1e-5, + 3.8833 * 1e-5, 8.7666 * 1e-5, + 1.8533 * 1e-4, 3.806 * 1e-4, + 7.713 * 1e-4, 1.55265 * 1e-3, + 3.1153 * 1e-3, 6.2406 * 1e-3, + 0.01249125, 0.0249925, + 0.049995, 0.1, + 0.2, 0.25, + 0.5, 0.8, + 0.9, 0.95, + 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-10); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-10); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-10); +} + +TEST(DirectSolverTakeTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2_CircularGeometry) +{ + std::vector radii = {0.15, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTake solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} +#endif + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/DirectSolver/directSolverNoMumps.cpp b/tests/DirectSolver/directSolverNoMumps.cpp new file mode 100644 index 00000000..d6903815 --- /dev/null +++ b/tests/DirectSolver/directSolverNoMumps.cpp @@ -0,0 +1,1305 @@ +#include + +#include +#include + +#include "../../include/GMGPolar/gmgpolar.h" + +#include "../../include/Residual/ResidualGive/residualGive.h" +#include "../../include/DirectSolver/DirectSolverGive/directSolverGive.h" +#include "../../include/DirectSolver/DirectSolverTake/directSolverTake.h" +#include "../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" +#include "../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" + +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" +#include "../../include/InputFunctions/boundaryConditions.h" +#include "../../include/InputFunctions/sourceTerm.h" +/* ------ */ +/* Test 1 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/circularGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR2_Boundary_CircularGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/sonnendruckerGyroCoefficients.h" +#include "../include/InputFunctions/SourceTerms/cartesianR2_SonnendruckerGyro_CircularGeometry.h" +/* ------ */ +/* Test 2 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/shafranovGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/cartesianR6_Boundary_ShafranovGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniGyroCoefficients.h" +#include "../include/InputFunctions/SourceTerms/cartesianR6_ZoniGyro_ShafranovGeometry.h" +/* ------ */ +/* Test 3 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" +/* ------ */ +/* Test 4 */ +/* ------ */ +#include "../include/InputFunctions/DomainGeometry/culhamGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/refined_Boundary_CulhamGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedGyroCoefficients.h" +#include "../include/InputFunctions/SourceTerms/refined_ZoniShiftedGyro_CulhamGeometry.h" + +namespace DirectSolverTestNoMumps +{ +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); + std::uniform_real_distribution dist(-100.0, 100.0); + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace DirectSolverTestNoMumps + +using namespace DirectSolverTestNoMumps; + +/* Test 1/2: */ +/* Does the Take and Give Implementation match up? */ + +TEST(DirectSolverTestNoMumps, directSolver_DirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); + + DirectSolverTakeCustomLU directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + DirectSolverGiveCustomLU directSolverTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + + Vector solution_Give = rhs; + directSolverGive_operator.solveInPlace(solution_Give); + + Vector solution_Take = rhs; + directSolverTake_operator.solveInPlace(solution_Take); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + } +} + +TEST(DirectSolverTestNoMumps, directSolver_AcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU directSolverGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + DirectSolverTakeCustomLU directSolverTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + + Vector solution_Give = rhs; + directSolverGive_operator.solveInPlace(solution_Give); + + Vector solution_Take = rhs; + directSolverTake_operator.solveInPlace(solution_Take); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-8); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-9); + } +} + +/* Test 2/2: */ +/* Are the DirectSolver and Residual are compatible with each other? */ + +/* -------- */ +/* Circular */ +/* -------- */ + +TEST(DirectSolverTestNoMumps_CircularGeometry, SequentialDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTestNoMumps_CircularGeometry, ParallelDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTestNoMumps_CircularGeometry, SequentialDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +TEST(DirectSolverTestNoMumps_CircularGeometry, ParallelDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* --------- */ +/* Shafranov */ +/* --------- */ + +TEST(DirectSolverTestNoMumps_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTestNoMumps_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Czarny */ +/* ------ */ + +TEST(DirectSolverTestNoMumps_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTestNoMumps_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Culham */ +/* ------ */ + +TEST(DirectSolverTestNoMumps_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-11); +} + +TEST(DirectSolverTestNoMumps_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-7); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* We adjust the PolarGrid to increase the precision */ + +TEST(DirectSolverTestNoMumps_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_CircularGeometry) +{ + std::vector radii = {1e-5, 1.441 * 1e-5, + 3.8833 * 1e-5, 8.7666 * 1e-5, + 1.8533 * 1e-4, 3.806 * 1e-4, + 7.713 * 1e-4, 1.55265 * 1e-3, + 3.1153 * 1e-3, 6.2406 * 1e-3, + 0.01249125, 0.0249925, + 0.049995, 0.1, + 0.2, 0.25, + 0.5, 0.8, + 0.9, 0.95, + 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-9); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-10); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-10); +} + +TEST(DirectSolverTestNoMumps_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2_CircularGeometry) +{ + std::vector radii = {0.15, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-10); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-11); +} + +/* Same test now using Take */ + +TEST(DirectSolverTakeCustomLUTest_CircularGeometry, SequentialDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeCustomLUTest_CircularGeometry, ParallelDirectSolverDirBC_Interior_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeCustomLUTest_CircularGeometry, SequentialDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +TEST(DirectSolverTakeCustomLUTest_CircularGeometry, ParallelDirectSolverAcrossOrigin_CircularGeometry) +{ + std::vector radii = {1e-5, 0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* --------- */ +/* Shafranov */ +/* --------- */ + +TEST(DirectSolverTakeCustomLUTest_ShafranovGeometry, DirectSolverDirBC_Interior_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeCustomLUTest_ShafranovGeometry, DirectSolverAcrossOrigin_ShafranovGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 0.2; + + ShafranovGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.4837 * Rmax; + std::unique_ptr coefficients = std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Czarny */ +/* ------ */ + +TEST(DirectSolverTakeCustomLUTest_CzarnyGeometry, DirectSolverDirBC_Interior_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-12); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +TEST(DirectSolverTakeCustomLUTest_CzarnyGeometry, DirectSolverAcrossOrigin_CzarnyGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-8); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +/* ------ */ +/* Culham */ +/* ------ */ + +TEST(DirectSolverTakeCustomLUTest_CulhamGeometry, DirectSolverDirBC_Interior_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-11); +} + +TEST(DirectSolverTakeCustomLUTest_CulhamGeometry, DirectSolverAcrossOrigin_CulhamGeometry) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CulhamGeometry domain_geometry(Rmax); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-7); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-7); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-8); +} + +TEST(DirectSolverTakeCustomLUTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision_CircularGeometry) +{ + std::vector radii = {1e-5, 1.441 * 1e-5, + 3.8833 * 1e-5, 8.7666 * 1e-5, + 1.8533 * 1e-4, 3.806 * 1e-4, + 7.713 * 1e-4, 1.55265 * 1e-3, + 3.1153 * 1e-3, 6.2406 * 1e-3, + 0.01249125, 0.0249925, + 0.049995, 0.1, + 0.2, 0.25, + 0.5, 0.8, + 0.9, 0.95, + 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-9); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-10); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-10); +} + +TEST(DirectSolverTakeCustomLUTest_CircularGeometry, DirectSolverAcrossOriginHigherPrecision2_CircularGeometry) +{ + std::vector radii = {0.15, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + + CircularGeometry domain_geometry(Rmax); + + double alpha_jump = 0.66 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax); + std::unique_ptr source_term = std::make_unique(Rmax); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector solution = rhs; + solver_op.solveInPlace(solution); + + Vector residuum(level.grid().numberOfNodes()); + residual_op.computeResidual(residuum, rhs, solution); + + ASSERT_NEAR(l1_norm(residuum), 0.0, 1e-11); + ASSERT_NEAR(sqrt(l2_norm_squared(residuum)), 0.0, 1e-11); + ASSERT_NEAR(infinity_norm(residuum), 0.0, 1e-12); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp new file mode 100644 index 00000000..014ed8ac --- /dev/null +++ b/tests/ExtrapolatedSmoother/extrapolated_smoother.cpp @@ -0,0 +1,1523 @@ +#include + +#include +#include + +#include "../../include/GMGPolar/gmgpolar.h" + +#include "../../include/Residual/ResidualGive/residualGive.h" +#include "../../include/Residual/ResidualTake/residualTake.h" +#include "../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" +#include "../../include/DirectSolver/DirectSolverTakeCustomLU/directSolverTakeCustomLU.h" +#include "../../include/ExtrapolatedSmoother/ExtrapolatedSmootherGive/extrapolatedSmootherGive.h" +#include "../../include/ExtrapolatedSmoother/ExtrapolatedSmootherTake/extrapolatedSmootherTake.h" + +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" +#include "../../include/InputFunctions/boundaryConditions.h" +#include "../../include/InputFunctions/sourceTerm.h" +/* --------- */ +/* Test Case */ +/* --------- */ +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" + +#include + +namespace ExtrapolatedExtrapolatedSmootherTest +{ +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); + std::uniform_real_distribution dist(-100.0, 100.0); + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace ExtrapolatedExtrapolatedSmootherTest + +using namespace ExtrapolatedExtrapolatedSmootherTest; + +/* Test 1/2: */ +/* Does the Take and Give Implementation match up? */ + +TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_DirBC_Interior) +{ + std::vector radii = {1e-2, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake smootherTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + Vector start = generate_random_sample_data(level.grid(), 24); + Vector temp = generate_random_sample_data(level.grid(), 8); + + Vector solution_Give = start; + smootherGive_operator.extrapolatedSmoothing(solution_Give, rhs, temp); + + Vector solution_Take = start; + smootherTake_operator.extrapolatedSmoothing(solution_Take, rhs, temp); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + } +} + +TEST(ExtrapolatedSmootherTest, extrapolatedSmoother_AcossOrigin) +{ + std::vector radii = {1e-2, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + ExtrapolatedSmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + ExtrapolatedSmootherTake smootherTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + Vector start = generate_random_sample_data(level.grid(), 24); + Vector temp = generate_random_sample_data(level.grid(), 8); + + Vector solution_Give = start; + smootherGive_operator.extrapolatedSmoothing(solution_Give, rhs, temp); + + Vector solution_Take = start; + smootherTake_operator.extrapolatedSmoothing(solution_Take, rhs, temp); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-8); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + } +} + +/* Test 2/2: */ +/* Does the smoother converge to the DirectSolverGiveCustomLU solution? */ + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > 1e-12) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 200); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + double precision = 1e-12; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 200); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 150); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherGive extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 150); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +/* We now test using "Take" */ + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > 1e-12) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 200); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + double precision = 1e-12; + + while (infinity_norm(error) > precision) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 200); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, SequentialExtrapolatedSmootherTakeAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 150); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(ExtrapolatedSmootherTest, ParallelExtrapolatedSmootherTakeAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.4, 0.45, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + DirectSolverTakeCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ExtrapolatedSmootherTake extrapolated_smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, + DirBC_Interior, maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + for (int i_r = 0; i_r < level.grid().nr(); i_r += 2) { + for (int i_theta = 0; i_theta < level.grid().ntheta(); i_theta += 2) { + smoother_solution[level.grid().index(i_r, i_theta)] = discrete_solution[level.grid().index(i_r, i_theta)]; + } + } + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + extrapolated_smoother_op.extrapolatedSmoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 150); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tests/Interpolation/extrapolated_prolongation.cpp b/tests/Interpolation/extrapolated_prolongation.cpp new file mode 100644 index 00000000..4a8818e9 --- /dev/null +++ b/tests/Interpolation/extrapolated_prolongation.cpp @@ -0,0 +1,81 @@ +#include + +#include + +#include "../../include/GMGPolar/gmgpolar.h" +#include "../../include/Interpolation/interpolation.h" +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" + +#include "../../include/InputFunctions/DomainGeometry/circularGeometry.h" +#include "../../include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h" + +namespace ExtrapolatedProlongationTest +{ +// Function to generate sample data for vector x using random values with seed +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); // Standard mersenne_twister_engine seeded with seed + std::uniform_real_distribution dist(0.0, 1.0); // Generate random double between 0 and 1 + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace ExtrapolatedProlongationTest + +using namespace ExtrapolatedProlongationTest; + +TEST(ExtrapolatedProlongationTest, ExtrapolatedProlongationSmoothingRadius) +{ + std::vector fine_radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector fine_angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = fine_radii.back(); + CircularGeometry domain_geometry(Rmax); + bool DirBC_Interior = true; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto finest_grid = std::make_unique(fine_radii, fine_angles); + auto coarse_grid = std::make_unique(coarseningGrid(*finest_grid)); + + std::unique_ptr coefficients = std::make_unique(); + auto finest_levelCache = std::make_unique(*finest_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + auto coarse_levelCache = std::make_unique(*coarse_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + + Level finest_level(0, std::move(finest_grid), std::move(finest_levelCache), + ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + Level coarse_level(1, std::move(coarse_grid), std::move(coarse_levelCache), + ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + const int maxOpenMPThreads = 16; + const std::vector threads_per_level = {maxOpenMPThreads, maxOpenMPThreads}; + + Interpolation interpolation_operator(threads_per_level, DirBC_Interior); + + unsigned int seed = 42; + Vector x = generate_random_sample_data(coarse_level.grid(), seed); + + // Apply prolongation to both functions + Vector result1(finest_level.grid().numberOfNodes()); + Vector result2(finest_level.grid().numberOfNodes()); + + interpolation_operator.applyExtrapolatedProlongation0(coarse_level, finest_level, result1, x); + interpolation_operator.applyExtrapolatedProlongation(coarse_level, finest_level, result2, x); + + ASSERT_EQ(result1.size(), result2.size()); + for (int i = 0; i < result1.size(); ++i) { + ASSERT_DOUBLE_EQ(result1[i], result2[i]); + } +} + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/Interpolation/extrapolated_restriction.cpp b/tests/Interpolation/extrapolated_restriction.cpp new file mode 100644 index 00000000..5b7c735f --- /dev/null +++ b/tests/Interpolation/extrapolated_restriction.cpp @@ -0,0 +1,168 @@ +#include + +#include + +#include "../../include/GMGPolar/gmgpolar.h" +#include "../../include/Interpolation/interpolation.h" +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" + +#include "../../include/InputFunctions/DomainGeometry/circularGeometry.h" +#include "../../include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h" + +namespace ExtrapolatedRestrictionTest +{ +// Function to generate sample data for vector x using random values with seed +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); // Standard mersenne_twister_engine seeded with seed + std::uniform_real_distribution dist(0.0, 1.0); // Generate random double between 0 and 1 + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} + +/* In src/Interpolation/restriction.cpp the Restriction Operator is implemented with "Take". */ +/* Here we test against the "Give" version. */ + +void applyExtrapolatedRestrictionGive0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + + assign(result, 0.0); + + for (int index = 0; index < fineGrid.numberOfNodes(); index++) { + std::array, space_dimension> neighbor_distance; + std::array, space_dimension> neighbors; + + MultiIndex fine_node = fineGrid.multiIndex(index); + + // Fine node appears in coarse grid + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 0) { + // Input x needs a fine grid index: x[FINE_INDEX] + // Result needs a coarse grid index: result[COARSE_INDEX] + MultiIndex coarse_node(fine_node[0] / 2, fine_node[1] / 2); + result[coarseGrid.index(coarse_node)] += x[index]; + } + + // Fine node between coarse nodes in theta direction + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 1) { + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + double k1 = neighbor_distance[1].first; + double k2 = neighbor_distance[1].second; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + MultiIndex bottom_coarse_node(fine_node[0] / 2, fine_node[1] / 2); + MultiIndex top_coarse_node(fine_node[0] / 2, (fine_node[1] / 2 + 1) % coarseGrid.ntheta()); + + result[coarseGrid.index(bottom_coarse_node)] += x[index] / 2.0; + result[coarseGrid.index(top_coarse_node)] += x[index] / 2.0; + } + + // Fine node between coarse nodes in radial direction + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 0) { + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + double h1 = neighbor_distance[0].first; + double h2 = neighbor_distance[0].second; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + MultiIndex left_coarse_node(fine_node[0] / 2, fine_node[1] / 2); + MultiIndex right_coarse_node(fine_node[0] / 2 + 1, fine_node[1] / 2); + + result[coarseGrid.index(left_coarse_node)] += x[index] / 2.0; + result[coarseGrid.index(right_coarse_node)] += x[index] / 2.0; + } + + //Fine node in the center of four coarse nodes + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 1) { + + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + double h1 = neighbor_distance[0].first; + double h2 = neighbor_distance[0].second; + double k1 = neighbor_distance[1].first; + double k2 = neighbor_distance[1].second; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + MultiIndex bottom_right_coarse_node(fine_node[0] / 2 + 1, fine_node[1] / 2); + MultiIndex top_left_coarse_node(fine_node[0] / 2, (fine_node[1] / 2 + 1) % coarseGrid.ntheta()); + + result[coarseGrid.index(bottom_right_coarse_node)] += x[index] / 2.0; + result[coarseGrid.index(top_left_coarse_node)] += x[index] / 2.0; + } + } +} +} // namespace ExtrapolatedRestrictionTest + +using namespace ExtrapolatedRestrictionTest; + +TEST(ExtrapolatedRestrictionTest, applyExtrapolatedRestriction) +{ + std::vector fine_radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector fine_angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = fine_radii.back(); + CircularGeometry domain_geometry(Rmax); + bool DirBC_Interior = true; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto finest_grid = std::make_unique(fine_radii, fine_angles); + auto coarse_grid = std::make_unique(coarseningGrid(*finest_grid)); + + std::unique_ptr coefficients = std::make_unique(); + auto finest_levelCache = std::make_unique(*finest_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + auto coarse_levelCache = std::make_unique(*coarse_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + + Level finest_level(0, std::move(finest_grid), std::move(finest_levelCache), + ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + Level coarse_level(1, std::move(coarse_grid), std::move(coarse_levelCache), + ExtrapolationType::IMPLICIT_EXTRAPOLATION, 0); + + const int maxOpenMPThreads = 16; + const std::vector threads_per_level = {maxOpenMPThreads, maxOpenMPThreads}; + + Interpolation interpolation_operator(threads_per_level, DirBC_Interior); + + unsigned int seed = 42; + Vector x = generate_random_sample_data(finest_level.grid(), seed); + + // Apply prolongation to both functions + Vector result1(coarse_level.grid().numberOfNodes()); + Vector result2(coarse_level.grid().numberOfNodes()); + Vector result3(coarse_level.grid().numberOfNodes()); + + interpolation_operator.applyExtrapolatedRestriction0(finest_level, coarse_level, result1, x); + interpolation_operator.applyExtrapolatedRestriction(finest_level, coarse_level, result2, x); + + applyExtrapolatedRestrictionGive0(finest_level, coarse_level, result3, x); + + ASSERT_EQ(result1.size(), result2.size()); + for (int i = 0; i < result1.size(); ++i) { + ASSERT_DOUBLE_EQ(result1[i], result2[i]); + } + ASSERT_EQ(result2.size(), result3.size()); + for (int i = 0; i < result2.size(); ++i) { + ASSERT_DOUBLE_EQ(result2[i], result3[i]); + } +} + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/Interpolation/prolongation.cpp b/tests/Interpolation/prolongation.cpp new file mode 100644 index 00000000..2d87c056 --- /dev/null +++ b/tests/Interpolation/prolongation.cpp @@ -0,0 +1,73 @@ +#include + +#include + +#include "../../include/GMGPolar/gmgpolar.h" +#include "../../include/Interpolation/interpolation.h" +#include "../../include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h" + +namespace ProlongationTest +{ +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); + std::uniform_real_distribution dist(-100.0, 100.0); + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace ProlongationTest + +using namespace ProlongationTest; + +TEST(ProlongationTest, ProlongationTest) +{ + std::vector fine_radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector fine_angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = fine_radii.back(); + CircularGeometry domain_geometry(Rmax); + bool DirBC_Interior = true; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto finest_grid = std::make_unique(fine_radii, fine_angles); + auto coarse_grid = std::make_unique(coarseningGrid(*finest_grid)); + + std::unique_ptr coefficients = std::make_unique(); + auto finest_levelCache = std::make_unique(*finest_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + auto coarse_levelCache = std::make_unique(*coarse_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + + Level finest_level(0, std::move(finest_grid), std::move(finest_levelCache), ExtrapolationType::NONE, 0); + Level coarse_level(1, std::move(coarse_grid), std::move(coarse_levelCache), ExtrapolationType::NONE, 0); + + const int maxOpenMPThreads = 16; + const std::vector threads_per_level = {maxOpenMPThreads, maxOpenMPThreads}; + + Interpolation interpolation_operator(threads_per_level, DirBC_Interior); + + Vector x = generate_random_sample_data(coarse_level.grid(), 42); + + // Apply prolongation to both functions + Vector result1(finest_level.grid().numberOfNodes()); + Vector result2(finest_level.grid().numberOfNodes()); + + interpolation_operator.applyProlongation0(coarse_level, finest_level, result1, x); + interpolation_operator.applyProlongation(coarse_level, finest_level, result2, x); + + ASSERT_EQ(result1.size(), result2.size()); + for (int i = 0; i < result1.size(); ++i) { + ASSERT_NEAR(result1[i], result2[i], 1e-10); + } +} + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/Interpolation/restriction.cpp b/tests/Interpolation/restriction.cpp new file mode 100644 index 00000000..0f16d5a2 --- /dev/null +++ b/tests/Interpolation/restriction.cpp @@ -0,0 +1,167 @@ +#include + +#include + +#include "../../include/GMGPolar/gmgpolar.h" +#include "../../include/Interpolation/interpolation.h" +#include "../../include/InputFunctions/DensityProfileCoefficients/poissonCoefficients.h" + +namespace RestrictionTest +{ +// Function to generate sample data for vector x using random values with seed +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); // Standard mersenne_twister_engine seeded with seed + std::uniform_real_distribution dist(0.0, 1.0); // Generate random double between 0 and 1 + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} + +/* In src/Interpolation/restriction.cpp the Restriction Operator is implemented with "Take". */ +/* Here we test against the "Give" version. */ +void applyRestrictionGive0(const Level& fromLevel, const Level& toLevel, Vector& result, + const Vector& x) +{ + assert(toLevel.level_depth() == fromLevel.level_depth() + 1); + + const PolarGrid& fineGrid = fromLevel.grid(); + const PolarGrid& coarseGrid = toLevel.grid(); + + assert(x.size() == fineGrid.numberOfNodes()); + assert(result.size() == coarseGrid.numberOfNodes()); + + assign(result, 0.0); + + for (int index = 0; index < fineGrid.numberOfNodes(); index++) { + std::array, space_dimension> neighbor_distance; + std::array, space_dimension> neighbors; + + MultiIndex fine_node = fineGrid.multiIndex(index); + + // Fine node appears in coarse grid + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 0) { + // Input x needs a fine grid index: x[FINE_INDEX] + // Result needs a coarse grid index: result[COARSE_INDEX] + MultiIndex coarse_node(fine_node[0] / 2, fine_node[1] / 2); + result[coarseGrid.index(coarse_node)] += x[index]; + } + + // Fine node between coarse nodes in theta direction + if (fine_node[0] % 2 == 0 && fine_node[1] % 2 == 1) { + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + double k1 = neighbor_distance[1].first; + double k2 = neighbor_distance[1].second; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + MultiIndex bottom_coarse_node(fine_node[0] / 2, fine_node[1] / 2); + MultiIndex top_coarse_node(fine_node[0] / 2, (fine_node[1] / 2 + 1) % coarseGrid.ntheta()); + + result[coarseGrid.index(bottom_coarse_node)] += k1 * x[index] / (k1 + k2); + result[coarseGrid.index(top_coarse_node)] += k2 * x[index] / (k1 + k2); + } + + // Fine node between coarse nodes in radial direction + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 0) { + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + double h1 = neighbor_distance[0].first; + double h2 = neighbor_distance[0].second; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + MultiIndex left_coarse_node(fine_node[0] / 2, fine_node[1] / 2); + MultiIndex right_coarse_node(fine_node[0] / 2 + 1, fine_node[1] / 2); + + result[coarseGrid.index(left_coarse_node)] += (h1 * x[index]) / (h1 + h2); + ; + result[coarseGrid.index(right_coarse_node)] += (h2 * x[index]) / (h1 + h2); + ; + } + + //Fine node in the center of four coarse nodes + if (fine_node[0] % 2 == 1 && fine_node[1] % 2 == 1) { + + fineGrid.adjacentNeighborDistances(fine_node, neighbor_distance); + double h1 = neighbor_distance[0].first; + double h2 = neighbor_distance[0].second; + double k1 = neighbor_distance[1].first; + double k2 = neighbor_distance[1].second; + + fineGrid.adjacentNeighborsOf(fine_node, neighbors); + + MultiIndex bottom_left_coarse_node(fine_node[0] / 2, fine_node[1] / 2); + MultiIndex bottom_right_coarse_node(fine_node[0] / 2 + 1, fine_node[1] / 2); + MultiIndex top_left_coarse_node(fine_node[0] / 2, (fine_node[1] / 2 + 1) % coarseGrid.ntheta()); + MultiIndex top_right_node(fine_node[0] / 2 + 1, (fine_node[1] / 2 + 1) % coarseGrid.ntheta()); + + result[coarseGrid.index(bottom_left_coarse_node)] += h1 * k1 * x[index] / ((h1 + h2) * (k1 + k2)); + result[coarseGrid.index(bottom_right_coarse_node)] += h2 * k1 * x[index] / ((h1 + h2) * (k1 + k2)); + result[coarseGrid.index(top_left_coarse_node)] += h1 * k2 * x[index] / ((h1 + h2) * (k1 + k2)); + result[coarseGrid.index(top_right_node)] += h2 * k2 * x[index] / ((h1 + h2) * (k1 + k2)); + } + } +} +} // namespace RestrictionTest + +using namespace RestrictionTest; + +TEST(RestrictionTest, applyRestriction) +{ + std::vector fine_radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector fine_angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = fine_radii.back(); + CircularGeometry domain_geometry(Rmax); + bool DirBC_Interior = true; + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto finest_grid = std::make_unique(fine_radii, fine_angles); + auto coarse_grid = std::make_unique(coarseningGrid(*finest_grid)); + + std::unique_ptr coefficients = std::make_unique(); + auto finest_levelCache = std::make_unique(*finest_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + auto coarse_levelCache = std::make_unique(*coarse_grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + + Level finest_level(0, std::move(finest_grid), std::move(finest_levelCache), ExtrapolationType::NONE, 0); + Level coarse_level(1, std::move(coarse_grid), std::move(coarse_levelCache), ExtrapolationType::NONE, 0); + + const int maxOpenMPThreads = 16; + const std::vector threads_per_level = {maxOpenMPThreads, maxOpenMPThreads}; + + Interpolation interpolation_operator(threads_per_level, DirBC_Interior); + + Vector x = generate_random_sample_data(finest_level.grid(), 42); + + // Apply prolongation to both functions + Vector result1(coarse_level.grid().numberOfNodes()); + Vector result2(coarse_level.grid().numberOfNodes()); + Vector result3(coarse_level.grid().numberOfNodes()); + + interpolation_operator.applyRestriction0(finest_level, coarse_level, result1, x); + interpolation_operator.applyRestriction(finest_level, coarse_level, result2, x); + + applyRestrictionGive0(finest_level, coarse_level, result3, x); + + ASSERT_EQ(result1.size(), result2.size()); + for (int i = 0; i < result1.size(); ++i) { + ASSERT_DOUBLE_EQ(result1[i], result2[i]); + } + + ASSERT_EQ(result2.size(), result3.size()); + for (int i = 0; i < result2.size(); ++i) { + ASSERT_DOUBLE_EQ(result2[i], result3[i]); + } +} + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/LinearAlgebra/csr_matrix.cpp b/tests/LinearAlgebra/csr_matrix.cpp new file mode 100644 index 00000000..f0c13cfe --- /dev/null +++ b/tests/LinearAlgebra/csr_matrix.cpp @@ -0,0 +1,369 @@ +#include + +#include "../../include/LinearAlgebra/csr_matrix.h" +#include "../../include/LinearAlgebra/sparseLUSolver.h" +#include "../../include/LinearAlgebra/vector.h" + +TEST(SparseMatrixCSR, default_construct) +{ + const SparseMatrixCSR v; + (void)v; +} + +TEST(SparseMatrixCSR, value_construct) +{ + using triplet = SparseMatrixCSR::triplet_type; + + const SparseMatrixCSR m(4, 3, + {triplet{0, 0, 1.0}, triplet{0, 2, 2.0}, triplet{1, 0, 3.0}, triplet{2, 0, 4.0}, + triplet{2, 1, 5.0}, triplet{2, 2, 6.0}, triplet{3, 2, 7.0}}); + + EXPECT_EQ(m.rows(), 4); + EXPECT_EQ(m.columns(), 3); + EXPECT_EQ(m.non_zero_size(), 7); + + EXPECT_EQ(m.row_nz_size(0), 2); + EXPECT_EQ(m.row_nz_size(1), 1); + EXPECT_EQ(m.row_nz_size(2), 3); + EXPECT_EQ(m.row_nz_size(3), 1); + + const double dense_values[4][3] = {{1.0, 0.0, 2.0}, {3.0, 0.0, 0.0}, {4.0, 5.0, 6.0}, {0.0, 0.0, 7.0}}; + + EXPECT_DOUBLE_EQ(m.row_nz_entry(0, 0), dense_values[0][m.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(0, 1), dense_values[0][m.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(1, 0), dense_values[1][m.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 0), dense_values[2][m.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 1), dense_values[2][m.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 2), dense_values[2][m.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(3, 0), dense_values[3][m.row_nz_index(3, 0)]); +} + +TEST(SparseMatrixCSR, copy_construct) +{ + using triplet = SparseMatrixCSR::triplet_type; + + const SparseMatrixCSR m1(4, 3, + {triplet{0, 0, 1.0}, triplet{0, 2, 2.0}, triplet{1, 0, 3.0}, triplet{2, 0, 4.0}, + triplet{2, 1, 5.0}, triplet{2, 2, 6.0}, triplet{3, 2, 7.0}}); + const SparseMatrixCSR m2 = m1; + + const double dense_values[4][3] = {{1.0, 0.0, 2.0}, {3.0, 0.0, 0.0}, {4.0, 5.0, 6.0}, {0.0, 0.0, 7.0}}; + + EXPECT_EQ(m1.rows(), 4); + EXPECT_EQ(m1.columns(), 3); + EXPECT_EQ(m1.non_zero_size(), 7); + + EXPECT_EQ(m1.row_nz_size(0), 2); + EXPECT_EQ(m1.row_nz_size(1), 1); + EXPECT_EQ(m1.row_nz_size(2), 3); + EXPECT_EQ(m1.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 0), dense_values[0][m1.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 1), dense_values[0][m1.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(1, 0), dense_values[1][m1.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 0), dense_values[2][m1.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 1), dense_values[2][m1.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 2), dense_values[2][m1.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(3, 0), dense_values[3][m1.row_nz_index(3, 0)]); + + EXPECT_EQ(m2.rows(), 4); + EXPECT_EQ(m2.columns(), 3); + EXPECT_EQ(m2.non_zero_size(), 7); + + EXPECT_EQ(m2.row_nz_size(0), 2); + EXPECT_EQ(m2.row_nz_size(1), 1); + EXPECT_EQ(m2.row_nz_size(2), 3); + EXPECT_EQ(m2.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 0), dense_values[0][m2.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 1), dense_values[0][m2.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(1, 0), dense_values[1][m2.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 0), dense_values[2][m2.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 1), dense_values[2][m2.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 2), dense_values[2][m2.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(3, 0), dense_values[3][m2.row_nz_index(3, 0)]); +} + +TEST(SparseMatrixCSR, copy_assign) +{ + const double dense_values[4][3] = {{1.0, 0.0, 2.0}, {3.0, 0.0, 0.0}, {4.0, 5.0, 6.0}, {0.0, 0.0, 7.0}}; + + SparseMatrixCSR m2; + + { + using triplet = SparseMatrixCSR::triplet_type; + + const SparseMatrixCSR m1(4, 3, + {triplet{0, 0, 1.0}, triplet{0, 2, 2.0}, triplet{1, 0, 3.0}, + triplet{2, 0, 4.0}, triplet{2, 1, 5.0}, triplet{2, 2, 6.0}, + triplet{3, 2, 7.0}}); + + m2 = m1; + + EXPECT_EQ(m1.rows(), 4); + EXPECT_EQ(m1.columns(), 3); + EXPECT_EQ(m1.non_zero_size(), 7); + + EXPECT_EQ(m1.row_nz_size(0), 2); + EXPECT_EQ(m1.row_nz_size(1), 1); + EXPECT_EQ(m1.row_nz_size(2), 3); + EXPECT_EQ(m1.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 0), dense_values[0][m1.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 1), dense_values[0][m1.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(1, 0), dense_values[1][m1.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 0), dense_values[2][m1.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 1), dense_values[2][m1.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 2), dense_values[2][m1.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(3, 0), dense_values[3][m1.row_nz_index(3, 0)]); + + EXPECT_EQ(m2.rows(), 4); + EXPECT_EQ(m2.columns(), 3); + EXPECT_EQ(m2.non_zero_size(), 7); + + EXPECT_EQ(m2.row_nz_size(0), 2); + EXPECT_EQ(m2.row_nz_size(1), 1); + EXPECT_EQ(m2.row_nz_size(2), 3); + EXPECT_EQ(m2.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 0), dense_values[0][m2.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 1), dense_values[0][m2.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(1, 0), dense_values[1][m2.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 0), dense_values[2][m2.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 1), dense_values[2][m2.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 2), dense_values[2][m2.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(3, 0), dense_values[3][m2.row_nz_index(3, 0)]); + } + + EXPECT_EQ(m2.rows(), 4); + EXPECT_EQ(m2.columns(), 3); + EXPECT_EQ(m2.non_zero_size(), 7); + + EXPECT_EQ(m2.row_nz_size(0), 2); + EXPECT_EQ(m2.row_nz_size(1), 1); + EXPECT_EQ(m2.row_nz_size(2), 3); + EXPECT_EQ(m2.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 0), dense_values[0][m2.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 1), dense_values[0][m2.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(1, 0), dense_values[1][m2.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 0), dense_values[2][m2.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 1), dense_values[2][m2.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 2), dense_values[2][m2.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(3, 0), dense_values[3][m2.row_nz_index(3, 0)]); +} + +TEST(SparseMatrixCSR, move_construct) +{ + const double dense_values[4][3] = {{1.0, 0.0, 2.0}, {3.0, 0.0, 0.0}, {4.0, 5.0, 6.0}, {0.0, 0.0, 7.0}}; + + using triplet = SparseMatrixCSR::triplet_type; + + const SparseMatrixCSR m1(4, 3, + {triplet{0, 0, 1.0}, triplet{0, 2, 2.0}, triplet{1, 0, 3.0}, triplet{2, 0, 4.0}, + triplet{2, 1, 5.0}, triplet{2, 2, 6.0}, triplet{3, 2, 7.0}}); + + EXPECT_EQ(m1.rows(), 4); + EXPECT_EQ(m1.columns(), 3); + EXPECT_EQ(m1.non_zero_size(), 7); + + EXPECT_EQ(m1.row_nz_size(0), 2); + EXPECT_EQ(m1.row_nz_size(1), 1); + EXPECT_EQ(m1.row_nz_size(2), 3); + EXPECT_EQ(m1.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 0), dense_values[0][m1.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 1), dense_values[0][m1.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(1, 0), dense_values[1][m1.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 0), dense_values[2][m1.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 1), dense_values[2][m1.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 2), dense_values[2][m1.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(3, 0), dense_values[3][m1.row_nz_index(3, 0)]); + + const SparseMatrixCSR m2 = std::move(m1); + + EXPECT_EQ(m2.rows(), 4); + EXPECT_EQ(m2.columns(), 3); + EXPECT_EQ(m2.non_zero_size(), 7); + + EXPECT_EQ(m2.row_nz_size(0), 2); + EXPECT_EQ(m2.row_nz_size(1), 1); + EXPECT_EQ(m2.row_nz_size(2), 3); + EXPECT_EQ(m2.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 0), dense_values[0][m2.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 1), dense_values[0][m2.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(1, 0), dense_values[1][m2.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 0), dense_values[2][m2.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 1), dense_values[2][m2.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 2), dense_values[2][m2.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(3, 0), dense_values[3][m2.row_nz_index(3, 0)]); +} + +TEST(SparseMatrixCSR, move_assign) +{ + const double dense_values[4][3] = {{1.0, 0.0, 2.0}, {3.0, 0.0, 0.0}, {4.0, 5.0, 6.0}, {0.0, 0.0, 7.0}}; + + using triplet = SparseMatrixCSR::triplet_type; + + SparseMatrixCSR m2; + + { + const SparseMatrixCSR m1(4, 3, + {triplet{0, 0, 1.0}, triplet{0, 2, 2.0}, triplet{1, 0, 3.0}, + triplet{2, 0, 4.0}, triplet{2, 1, 5.0}, triplet{2, 2, 6.0}, + triplet{3, 2, 7.0}}); + + EXPECT_EQ(m1.rows(), 4); + EXPECT_EQ(m1.columns(), 3); + EXPECT_EQ(m1.non_zero_size(), 7); + + EXPECT_EQ(m1.row_nz_size(0), 2); + EXPECT_EQ(m1.row_nz_size(1), 1); + EXPECT_EQ(m1.row_nz_size(2), 3); + EXPECT_EQ(m1.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 0), dense_values[0][m1.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(0, 1), dense_values[0][m1.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(1, 0), dense_values[1][m1.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 0), dense_values[2][m1.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 1), dense_values[2][m1.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(2, 2), dense_values[2][m1.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m1.row_nz_entry(3, 0), dense_values[3][m1.row_nz_index(3, 0)]); + + m2 = std::move(m1); + + EXPECT_EQ(m2.rows(), 4); + EXPECT_EQ(m2.columns(), 3); + EXPECT_EQ(m2.non_zero_size(), 7); + + EXPECT_EQ(m2.row_nz_size(0), 2); + EXPECT_EQ(m2.row_nz_size(1), 1); + EXPECT_EQ(m2.row_nz_size(2), 3); + EXPECT_EQ(m2.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 0), dense_values[0][m2.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 1), dense_values[0][m2.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(1, 0), dense_values[1][m2.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 0), dense_values[2][m2.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 1), dense_values[2][m2.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 2), dense_values[2][m2.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(3, 0), dense_values[3][m2.row_nz_index(3, 0)]); + } + + EXPECT_EQ(m2.rows(), 4); + EXPECT_EQ(m2.columns(), 3); + EXPECT_EQ(m2.non_zero_size(), 7); + + EXPECT_EQ(m2.row_nz_size(0), 2); + EXPECT_EQ(m2.row_nz_size(1), 1); + EXPECT_EQ(m2.row_nz_size(2), 3); + EXPECT_EQ(m2.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 0), dense_values[0][m2.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(0, 1), dense_values[0][m2.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(1, 0), dense_values[1][m2.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 0), dense_values[2][m2.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 1), dense_values[2][m2.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(2, 2), dense_values[2][m2.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m2.row_nz_entry(3, 0), dense_values[3][m2.row_nz_index(3, 0)]); +} + +TEST(SparseMatrixCSR, value_construct_modify) +{ + using triplet = SparseMatrixCSR::triplet_type; + + SparseMatrixCSR m(4, 3, + {triplet{0, 0, 1.0}, triplet{0, 2, 2.0}, triplet{1, 0, 3.0}, triplet{2, 0, 4.0}, + triplet{2, 1, 5.0}, triplet{2, 2, 6.0}, triplet{3, 2, 7.0}}); + + EXPECT_EQ(m.rows(), 4); + EXPECT_EQ(m.columns(), 3); + EXPECT_EQ(m.non_zero_size(), 7); + + EXPECT_EQ(m.row_nz_size(0), 2); + EXPECT_EQ(m.row_nz_size(1), 1); + EXPECT_EQ(m.row_nz_size(2), 3); + EXPECT_EQ(m.row_nz_size(3), 1); + + const double dense_values[4][3] = {{1.0, 0.0, 2.0}, {3.0, 0.0, 0.0}, {4.0, 5.0, 6.0}, {0.0, 0.0, 7.0}}; + + EXPECT_DOUBLE_EQ(m.row_nz_entry(0, 0), dense_values[0][m.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(0, 1), dense_values[0][m.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(1, 0), dense_values[1][m.row_nz_index(1, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 0), dense_values[2][m.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 1), dense_values[2][m.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 2), dense_values[2][m.row_nz_index(2, 2)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(3, 0), dense_values[3][m.row_nz_index(3, 0)]); + + m.row_nz_entry(1, 0) = 8.0; + m.row_nz_entry(2, 2) = 9.0; + + EXPECT_EQ(m.rows(), 4); + EXPECT_EQ(m.columns(), 3); + EXPECT_EQ(m.non_zero_size(), 7); + + EXPECT_EQ(m.row_nz_size(0), 2); + EXPECT_EQ(m.row_nz_size(1), 1); + EXPECT_EQ(m.row_nz_size(2), 3); + EXPECT_EQ(m.row_nz_size(3), 1); + + EXPECT_DOUBLE_EQ(m.row_nz_entry(0, 0), dense_values[0][m.row_nz_index(0, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(0, 1), dense_values[0][m.row_nz_index(0, 1)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(1, 0), 8.0); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 0), dense_values[2][m.row_nz_index(2, 0)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 1), dense_values[2][m.row_nz_index(2, 1)]); + EXPECT_DOUBLE_EQ(m.row_nz_entry(2, 2), 9.0); + EXPECT_DOUBLE_EQ(m.row_nz_entry(3, 0), dense_values[3][m.row_nz_index(3, 0)]); +} + +TEST(SparseMatrixCSR, lu_solver_3x3) +{ + using triplet = SparseMatrixCSR::triplet_type; + + SparseMatrixCSR matrix(3, 3, + {triplet{0, 0, 2.0}, triplet{0, 2, -10.0}, triplet{1, 0, -1.0}, triplet{1, 1, 2.0}, + triplet{1, 2, -1.0}, triplet{2, 0, -7.0}, triplet{2, 2, 2.0}}); + + Vector rhs = {1.0, -5, 3.0}; + Vector exact_solution = {-16.0 / 33.0, -125.0 / 44.0, -13.0 / 66.0}; + + SparseLUSolver solver(matrix); + solver.solveInPlace(rhs); + + EXPECT_DOUBLE_EQ(rhs[0], exact_solution[0]); + EXPECT_DOUBLE_EQ(rhs[1], exact_solution[1]); + EXPECT_DOUBLE_EQ(rhs[2], exact_solution[2]); +} + +TEST(SparseMatrixCSR, lu_solver_5x5) +{ + using triplet = SparseMatrixCSR::triplet_type; + + SparseMatrixCSR matrix(5, 5, + {triplet{0, 0, 2.0}, triplet{0, 3, 7.0}, triplet{0, 4, 3.0}, triplet{1, 0, -1.0}, + triplet{1, 1, -5.0}, triplet{1, 2, -1.0}, triplet{1, 3, 5.0}, triplet{1, 4, 6.0}, + triplet{2, 1, -7.0}, triplet{2, 2, 1.0}, triplet{2, 3, 2.0}, triplet{2, 4, -4.0}, + triplet{3, 2, -4.0}, triplet{3, 3, 6.0}, triplet{3, 4, 9.0}, triplet{4, 0, 2.0}, + triplet{4, 1, 4.0}, triplet{4, 3, -4.0}, triplet{4, 4, 9.0}}); + + Vector rhs = {1.0, -5, 3.0, 7.0, 2.0}; + Vector exact_solution = {2792.0 / 567.0, -589.0 / 648.0, -7615.0 / 1512.0, -1013.0 / 1134.0, + -109.0 / 126.0}; + + SparseLUSolver solver(matrix); + solver.solveInPlace(rhs); + + EXPECT_DOUBLE_EQ(rhs[0], exact_solution[0]); + EXPECT_DOUBLE_EQ(rhs[1], exact_solution[1]); + EXPECT_DOUBLE_EQ(rhs[2], exact_solution[2]); + EXPECT_DOUBLE_EQ(rhs[3], exact_solution[3]); + EXPECT_DOUBLE_EQ(rhs[4], exact_solution[4]); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + const auto test_result_status = RUN_ALL_TESTS(); + return test_result_status; +} \ No newline at end of file diff --git a/tests/LinearAlgebra/cyclic_tridiagonal_solver.cpp b/tests/LinearAlgebra/cyclic_tridiagonal_solver.cpp new file mode 100644 index 00000000..9e45879c --- /dev/null +++ b/tests/LinearAlgebra/cyclic_tridiagonal_solver.cpp @@ -0,0 +1,667 @@ +#include + +#include + +#include "../../include/LinearAlgebra/vector.h" +#include "../../include/LinearAlgebra/vector_operations.h" +#include "../../include/LinearAlgebra/symmetricTridiagonalSolver.h" + +// ----------------------------- // +// cyclic_corner_element() = 0.0 // +// ----------------------------- // + +TEST(ZeroCyclicSymmetricTridiagonalSolver, diagonal_dominant_n_3) +{ + const int n = 3; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + solver.main_diagonal(0) = -5.0; + solver.main_diagonal(1) = 10.0; + solver.main_diagonal(2) = 12.0; + solver.sub_diagonal(0) = 1.0; + solver.sub_diagonal(1) = -9.0; + + Vector rhs(n); + rhs[0] = 65.0; + rhs[1] = -10.5; + rhs[2] = 13.6; + + Vector exact_solution(n); + exact_solution[0] = -4231.0 / 345.0; + exact_solution[1] = 254.0 / 69.0; + exact_solution[2] = 2687.0 / 690.0; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + EXPECT_NEAR(rhs[2], exact_solution[2], 1e-12); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(ZeroCyclicSymmetricTridiagonalSolver, not_diagonal_dominant_n_3) +{ + const int n = 3; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + solver.main_diagonal(0) = -1.0; + solver.main_diagonal(1) = 0.001; + solver.main_diagonal(2) = 0.6; + solver.sub_diagonal(0) = -20.0; + solver.sub_diagonal(1) = -9.0; + + Vector rhs(n); + rhs[0] = 65.0; + rhs[1] = -10.5; + rhs[2] = 13.6; + + Vector exact_solution(n); + exact_solution[0] = 4904935.0 / 265001.0; + exact_solution[1] = -1106500.0 / 265001.0; + exact_solution[2] = -31772432.0 / 795003.0; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + EXPECT_NEAR(rhs[2], exact_solution[2], 1e-12); + + EXPECT_DOUBLE_EQ(rhs[0], exact_solution[0]); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(ZeroCyclicSymmetricTridiagonalSolver, random_tridiagonal_n_10) +{ + const int n = 10; + const double precision = 1e-10; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(ZeroCyclicSymmetricTridiagonalSolver, random_tridiagonal_n_100) +{ + const int n = 100; + + const double precision = 1e-8; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(ZeroCyclicSymmetricTridiagonalSolver, random_tridiagonal_n_1000) +{ + const int n = 1000; + + const double precision = 1e-7; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(ZeroCyclicSymmetricTridiagonalSolver, random_tridiagonal_n_10000) +{ + const int n = 10000; + + const double precision = 1e-7; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(ZeroCyclicSymmetricTridiagonalSolver, random_tridiagonal_boosted_subdiagonal_LOW_PRECISION_n_10000) +{ + const int n = 10000; + + const double precision = 1e-4; + + const double subdiagonal_boost = 10000.0; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 0.0; + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = subdiagonal_boost * dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +// ------------------------------ // +// cyclic_corner_element() != 0.0 // +// ------------------------------ // + +TEST(CyclicSymmetricTridiagonalSolver, diagonal_dominant_n_3) +{ + const int n = 3; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = -3.0; + solver.main_diagonal(0) = -5.0; + solver.main_diagonal(1) = 10.0; + solver.main_diagonal(2) = 12.0; + solver.sub_diagonal(0) = 1.0; + solver.sub_diagonal(1) = -9.0; + + Vector rhs(n); + rhs[0] = 65.0; + rhs[1] = -10.5; + rhs[2] = 13.6; + + Vector exact_solution(n); + exact_solution[0] = -2959.0 / 270.0; + exact_solution[1] = -1163.0 / 270.0; + exact_solution[2] = -653 / 135.0; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + EXPECT_NEAR(rhs[2], exact_solution[2], 1e-12); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(CyclicSymmetricTridiagonalSolver, not_diagonal_dominant_n_3) +{ + const int n = 3; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + solver.cyclic_corner_element() = 6.0; + solver.main_diagonal(0) = -1.0; + solver.main_diagonal(1) = 0.001; + solver.main_diagonal(2) = 0.6; + solver.sub_diagonal(0) = -20.0; + solver.sub_diagonal(1) = -9.0; + + Vector rhs(n); + rhs[0] = 65.0; + rhs[1] = -10.5; + rhs[2] = 13.6; + + Vector exact_solution(n); + exact_solution[0] = -3960071.0 / 3334939.0; + exact_solution[1] = -6833500.0 / 3334939.0; + exact_solution[2] = 38070482.0 / 10004817.0; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + EXPECT_NEAR(rhs[2], exact_solution[2], 1e-12); + + EXPECT_DOUBLE_EQ(rhs[0], exact_solution[0]); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(CyclicSymmetricTridiagonalSolver, random_tridiagonal_n_10) +{ + const int n = 10; + const double precision = 1e-9; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + solver.cyclic_corner_element() = dis(gen); + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1] + + copy_solver.cyclic_corner_element() * rhs[n - 1], + copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1] + + copy_solver.cyclic_corner_element() * rhs[0], + copy_rhs[n - 1], precision); +} + +TEST(CyclicSymmetricTridiagonalSolver, random_tridiagonal_n_100) +{ + const int n = 100; + + const double precision = 1e-9; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + solver.cyclic_corner_element() = dis(gen); + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1] + + copy_solver.cyclic_corner_element() * rhs[n - 1], + copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1] + + copy_solver.cyclic_corner_element() * rhs[0], + copy_rhs[n - 1], precision); +} + +TEST(CyclicSymmetricTridiagonalSolver, random_tridiagonal_n_1000) +{ + const int n = 1000; + + const double precision = 1e-8; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + solver.cyclic_corner_element() = dis(gen); + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1] + + copy_solver.cyclic_corner_element() * rhs[n - 1], + copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1] + + copy_solver.cyclic_corner_element() * rhs[0], + copy_rhs[n - 1], precision); +} + +TEST(CyclicSymmetricTridiagonalSolver, random_tridiagonal_n_10000) +{ + const int n = 10000; + + const double precision = 1e-7; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + solver.cyclic_corner_element() = dis(gen); + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1] + + copy_solver.cyclic_corner_element() * rhs[n - 1], + copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1] + + copy_solver.cyclic_corner_element() * rhs[0], + copy_rhs[n - 1], precision); +} + +TEST(CyclicSymmetricTridiagonalSolver, random_tridiagonal_boosted_subdiagonal_LOW_PRECISION_n_10000) +{ + const int n = 10000; + + const double precision = 1e-3; + + const double subdiagonal_boost = 10000.0; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(true); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = subdiagonal_boost * dis(gen); + } + solver.cyclic_corner_element() = subdiagonal_boost * dis(gen); + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp1(n); + Vector temp2(n); + solver.solveInPlace(rhs.begin(), temp1.begin(), temp2.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1] + + copy_solver.cyclic_corner_element() * rhs[n - 1], + copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1] + + copy_solver.cyclic_corner_element() * rhs[0], + copy_rhs[n - 1], precision); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/LinearAlgebra/matrix.cpp b/tests/LinearAlgebra/matrix.cpp new file mode 100644 index 00000000..c40c4071 --- /dev/null +++ b/tests/LinearAlgebra/matrix.cpp @@ -0,0 +1,240 @@ +#include + +#include "../../include/LinearAlgebra/coo_matrix.h" + +// Alias for readability +using triplet = std::tuple; + +/* Default Construct (double) */ + +TEST(SparseMatrixDouble, default_construct) +{ + const SparseMatrixCOO m; + (void)m; +} + +/* Size Construct (double) */ + +TEST(SparseMatrixDouble, size_construct) +{ + const SparseMatrixCOO m(5, 5, 0); + ASSERT_EQ(m.rows(), 5); + ASSERT_EQ(m.columns(), 5); + ASSERT_EQ(m.non_zero_size(), 0); +} + +/* Entries Construct (double) */ + +TEST(SparseMatrixDouble, entries_construct) +{ + std::vector entries = {{0, 0, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}}; + const SparseMatrixCOO m(3, 3, entries); + + ASSERT_EQ(m.rows(), 3); + ASSERT_EQ(m.columns(), 3); + ASSERT_EQ(m.non_zero_size(), 3); + + EXPECT_EQ(m.row_index(0), 0); + EXPECT_EQ(m.col_index(0), 0); + EXPECT_DOUBLE_EQ(m.value(0), 1.0); + + EXPECT_EQ(m.row_index(1), 1); + EXPECT_EQ(m.col_index(1), 2); + EXPECT_DOUBLE_EQ(m.value(1), 2.0); + + EXPECT_EQ(m.row_index(2), 2); + EXPECT_EQ(m.col_index(2), 1); + EXPECT_DOUBLE_EQ(m.value(2), 3.0); +} + +/* Copy Construct (double) */ + +TEST(SparseMatrixDouble, copy_construct) +{ + std::vector entries = {{0, 0, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}}; + const SparseMatrixCOO m1(3, 3, entries); + const SparseMatrixCOO m2 = m1; + + ASSERT_EQ(m2.rows(), 3); + ASSERT_EQ(m2.columns(), 3); + ASSERT_EQ(m2.non_zero_size(), 3); + + EXPECT_EQ(m2.row_index(0), 0); + EXPECT_EQ(m2.col_index(0), 0); + EXPECT_DOUBLE_EQ(m2.value(0), 1.0); + + EXPECT_EQ(m2.row_index(1), 1); + EXPECT_EQ(m2.col_index(1), 2); + EXPECT_DOUBLE_EQ(m2.value(1), 2.0); + + EXPECT_EQ(m2.row_index(2), 2); + EXPECT_EQ(m2.col_index(2), 1); + EXPECT_DOUBLE_EQ(m2.value(2), 3.0); +} + +/* Move Construct (double) */ + +TEST(SparseMatrixDouble, move_construct) +{ + std::vector entries = {{0, 0, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}}; + SparseMatrixCOO m1(3, 3, entries); + + ASSERT_EQ(m1.rows(), 3); + ASSERT_EQ(m1.columns(), 3); + ASSERT_EQ(m1.non_zero_size(), 3); + + SparseMatrixCOO m2 = std::move(m1); + + ASSERT_EQ(m2.rows(), 3); + ASSERT_EQ(m2.columns(), 3); + ASSERT_EQ(m2.non_zero_size(), 3); + + EXPECT_EQ(m2.row_index(0), 0); + EXPECT_EQ(m2.col_index(0), 0); + EXPECT_DOUBLE_EQ(m2.value(0), 1.0); + + EXPECT_EQ(m2.row_index(1), 1); + EXPECT_EQ(m2.col_index(1), 2); + EXPECT_DOUBLE_EQ(m2.value(1), 2.0); + + EXPECT_EQ(m2.row_index(2), 2); + EXPECT_EQ(m2.col_index(2), 1); + EXPECT_DOUBLE_EQ(m2.value(2), 3.0); +} + +/* Copy Assign (double) */ + +TEST(SparseMatrixDouble, copy_assign) +{ + std::vector entries = {{0, 0, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}}; + const SparseMatrixCOO m1(3, 3, entries); + SparseMatrixCOO m2; + + m2 = m1; + + ASSERT_EQ(m2.rows(), 3); + ASSERT_EQ(m2.columns(), 3); + ASSERT_EQ(m2.non_zero_size(), 3); + + EXPECT_EQ(m2.row_index(0), 0); + EXPECT_EQ(m2.col_index(0), 0); + EXPECT_DOUBLE_EQ(m2.value(0), 1.0); + + EXPECT_EQ(m2.row_index(1), 1); + EXPECT_EQ(m2.col_index(1), 2); + EXPECT_DOUBLE_EQ(m2.value(1), 2.0); + + EXPECT_EQ(m2.row_index(2), 2); + EXPECT_EQ(m2.col_index(2), 1); + EXPECT_DOUBLE_EQ(m2.value(2), 3.0); +} + +/* Move Assign (double) */ + +TEST(SparseMatrixDouble, move_assign) +{ + std::vector entries = {{0, 0, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}}; + SparseMatrixCOO m1(3, 3, entries); + SparseMatrixCOO m2; + + m2 = std::move(m1); + + ASSERT_EQ(m2.rows(), 3); + ASSERT_EQ(m2.columns(), 3); + ASSERT_EQ(m2.non_zero_size(), 3); + + EXPECT_EQ(m2.row_index(0), 0); + EXPECT_EQ(m2.col_index(0), 0); + EXPECT_DOUBLE_EQ(m2.value(0), 1.0); + + EXPECT_EQ(m2.row_index(1), 1); + EXPECT_EQ(m2.col_index(1), 2); + EXPECT_DOUBLE_EQ(m2.value(1), 2.0); + + EXPECT_EQ(m2.row_index(2), 2); + EXPECT_EQ(m2.col_index(2), 1); + EXPECT_DOUBLE_EQ(m2.value(2), 3.0); +} + +/* Value Modify (double) */ + +TEST(SparseMatrixDouble, value_modify) +{ + std::vector entries = {{0, 0, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}}; + SparseMatrixCOO m(3, 3, entries); + + ASSERT_EQ(m.rows(), 3); + ASSERT_EQ(m.columns(), 3); + ASSERT_EQ(m.non_zero_size(), 3); + + EXPECT_DOUBLE_EQ(m.value(2), 3.0); + + m.value(2) = 5.0; + EXPECT_DOUBLE_EQ(m.value(2), 5.0); +} + +/* Modify Construction (double) */ + +TEST(SparseMatrixDouble, modify_construction) +{ + const int rows = 4; + const int columns = 5; + const int nnz = 6; + SparseMatrixCOO matrixA(rows, columns, nnz); + + matrixA.row_index(0) = 0; + matrixA.col_index(0) = 1; + matrixA.value(0) = 2.0; + + matrixA.row_index(1) = 1; + matrixA.col_index(1) = 0; + matrixA.value(1) = 8.0; + + matrixA.row_index(2) = 1; + matrixA.col_index(2) = 3; + matrixA.value(2) = -6.0; + + matrixA.row_index(3) = 2; + matrixA.col_index(3) = 0; + matrixA.value(3) = -5.0; + + matrixA.row_index(4) = 3; + matrixA.col_index(4) = 1; + matrixA.value(4) = 7.0; + + matrixA.row_index(5) = 3; + matrixA.col_index(5) = 3; + matrixA.value(5) = 3.0; + + ASSERT_EQ(matrixA.rows(), 4); + ASSERT_EQ(matrixA.columns(), 5); + ASSERT_EQ(matrixA.non_zero_size(), 6); + + std::vector entries = {{0, 1, 2.0}, {1, 0, 8.0}, {1, 3, -6.0}, {2, 0, -5.0}, {3, 1, 7.0}, {3, 3, 3.0}}; + + SparseMatrixCOO matrixB(rows, columns, entries); + + for (int i = 0; i < nnz; i++) { + ASSERT_EQ(matrixA.row_index(i), matrixB.row_index(i)); + ASSERT_EQ(matrixA.col_index(i), matrixB.col_index(i)); + EXPECT_DOUBLE_EQ(matrixA.value(i), matrixB.value(i)); + } +} + +/* Symmetry Check (double) */ + +TEST(SparseMatrixDouble, symmetry_check) +{ + std::vector entries = {{0, 1, 2.0}, {1, 1, -3.0}, {1, 2, 3.0}}; + SparseMatrixCOO m(3, 3, entries); + + ASSERT_FALSE(m.is_symmetric()); + m.is_symmetric(true); + ASSERT_TRUE(m.is_symmetric()); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/LinearAlgebra/tridiagonal_solver.cpp b/tests/LinearAlgebra/tridiagonal_solver.cpp new file mode 100644 index 00000000..b1525f16 --- /dev/null +++ b/tests/LinearAlgebra/tridiagonal_solver.cpp @@ -0,0 +1,369 @@ +#include + +#include + +#include "../../include/LinearAlgebra/vector.h" +#include "../../include/LinearAlgebra/vector_operations.h" +#include "../../include/LinearAlgebra/symmetricTridiagonalSolver.h" + +TEST(SymmetricTridiagonalSolver, diagonal_dominant_n_2) +{ + const int n = 2; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + solver.main_diagonal(0) = -4.0; + solver.main_diagonal(1) = 8.0; + solver.sub_diagonal(0) = 1.0; + + Vector rhs(n); + rhs[0] = 3.0; + rhs[1] = -2.0; + + Vector exact_solution(n); + exact_solution[0] = -26.0 / 33.0; + exact_solution[1] = -5.0 / 33.0; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(SymmetricTridiagonalSolver, not_diagonal_dominant_n_2) +{ + const int n = 2; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + solver.main_diagonal(0) = -4.0; + solver.main_diagonal(1) = 8.0; + solver.sub_diagonal(0) = 1000.0; + + Vector rhs(n); + rhs[0] = 3.0; + rhs[1] = -2.0; + + Vector exact_solution(n); + exact_solution[0] = -23.0 / 11364.0; + exact_solution[1] = 17.0 / 5682.0; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(SymmetricTridiagonalSolver, diagonal_dominant_n_3) +{ + const int n = 3; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + solver.main_diagonal(0) = -5.0; + solver.main_diagonal(1) = 10.0; + solver.main_diagonal(2) = 12.0; + solver.sub_diagonal(0) = 1.0; + solver.sub_diagonal(1) = -9.0; + + Vector rhs(n); + rhs[0] = 65.0; + rhs[1] = -10.5; + rhs[2] = 13.6; + + Vector exact_solution(n); + exact_solution[0] = -4231.0 / 345.0; + exact_solution[1] = 254.0 / 69.0; + exact_solution[2] = 2687.0 / 690.0; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + EXPECT_NEAR(rhs[2], exact_solution[2], 1e-12); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(SymmetricTridiagonalSolver, not_diagonal_dominant_n_3) +{ + const int n = 3; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + solver.main_diagonal(0) = -1.0; + solver.main_diagonal(1) = 0.001; + solver.main_diagonal(2) = 0.6; + solver.sub_diagonal(0) = -20.0; + solver.sub_diagonal(1) = -9.0; + + Vector rhs(n); + rhs[0] = 65.0; + rhs[1] = -10.5; + rhs[2] = 13.6; + + Vector exact_solution(n); + exact_solution[0] = 4904935.0 / 265001.0; + exact_solution[1] = -1106500.0 / 265001.0; + exact_solution[2] = -31772432.0 / 795003.0; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(rhs[0], exact_solution[0], 1e-12); + EXPECT_NEAR(rhs[1], exact_solution[1], 1e-12); + EXPECT_NEAR(rhs[2], exact_solution[2], 1e-12); + + EXPECT_DOUBLE_EQ(rhs[0], exact_solution[0]); + + EXPECT_TRUE(equals(rhs, exact_solution)); +} + +TEST(SymmetricTridiagonalSolver, random_tridiagonal_n_10) +{ + const int n = 10; + const double precision = 1e-9; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(SymmetricTridiagonalSolver, random_tridiagonal_n_100) +{ + const int n = 100; + + const double precision = 1e-8; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(SymmetricTridiagonalSolver, random_tridiagonal_n_1000) +{ + const int n = 1000; + + const double precision = 1e-8; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(SymmetricTridiagonalSolver, random_tridiagonal_n_10000) +{ + const int n = 10000; + + const double precision = 1e-7; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(42); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +TEST(SymmetricTridiagonalSolver, random_tridiagonal_boosted_subdiagonal_LOW_PRECISION_n_10000) +{ + const int n = 10000; + + const double precision = 1e-3; + + const double subdiagonal_boost = 10000.0; + + SymmetricTridiagonalSolver solver(n); + solver.is_cyclic(false); + + // Create random number generator + std::random_device rd; + std::mt19937 gen(79); + std::uniform_real_distribution<> dis(-100.0, 100.0); + + // Fill main_diagonal with random values + for (int i = 0; i < n; ++i) { + solver.main_diagonal(i) = dis(gen); + } + + // Fill sub_diagonal with random values + for (int i = 0; i < n - 1; ++i) { + solver.sub_diagonal(i) = subdiagonal_boost * dis(gen); + } + + const SymmetricTridiagonalSolver copy_solver = solver; + + // Fill rhs with random values + Vector rhs(n); + for (int i = 0; i < n; ++i) { + rhs[i] = dis(gen); + } + + const Vector copy_rhs = rhs; + + Vector temp(n); + solver.solveInPlace(rhs.begin(), temp.begin()); + + EXPECT_NEAR(copy_solver.main_diagonal(0) * rhs[0] + copy_solver.sub_diagonal(0) * rhs[1], copy_rhs[0], precision); + for (int i = 1; i < n - 1; ++i) { + EXPECT_NEAR(copy_solver.sub_diagonal(i - 1) * rhs[i - 1] + copy_solver.main_diagonal(i) * rhs[i] + + copy_solver.sub_diagonal(i) * rhs[i + 1], + copy_rhs[i], precision); + } + EXPECT_NEAR(copy_solver.sub_diagonal(n - 2) * rhs[n - 2] + copy_solver.main_diagonal(n - 1) * rhs[n - 1], + copy_rhs[n - 1], precision); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/LinearAlgebra/vector.cpp b/tests/LinearAlgebra/vector.cpp new file mode 100644 index 00000000..1aacdafc --- /dev/null +++ b/tests/LinearAlgebra/vector.cpp @@ -0,0 +1,463 @@ +#include + +#include + +#include "../../include/LinearAlgebra/vector.h" + +#define EXPECT_DOUBLE_COMPLEX_EQ(a, b) \ + EXPECT_DOUBLE_EQ((a).real(), (b).real()); \ + EXPECT_DOUBLE_EQ((a).imag(), (b).imag()) + +// -------------- // +// Vector // +// -------------- // + +/* Default Construct (double) */ + +TEST(VectorDouble, default_construct) +{ + const Vector v; + (void)v; +} + +/* Value Construct (double) */ + +TEST(VectorDouble, value_construct) +{ + const Vector v = {1.0, 2.0, 3.0}; + ASSERT_EQ(v.size(), 3); + EXPECT_DOUBLE_EQ(v[0], 1.0); + EXPECT_DOUBLE_EQ(v[1], 2.0); + EXPECT_DOUBLE_EQ(v[2], 3.0); +} + +/* Size Construct (double) */ + +TEST(VectorDouble, size_construct) +{ + const Vector v(5); + ASSERT_EQ(v.size(), 5); +} + +/* Copy Construct (double) */ + +TEST(VectorDouble, copy_construct) +{ + const Vector v1 = {1.0, 2.0, 3.0}; + const Vector v2 = v1; + + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_EQ(v1[0], 1.0); + EXPECT_DOUBLE_EQ(v1[1], 2.0); + EXPECT_DOUBLE_EQ(v1[2], 3.0); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_EQ(v2[0], 1.0); + EXPECT_DOUBLE_EQ(v2[1], 2.0); + EXPECT_DOUBLE_EQ(v2[2], 3.0); +} + +/* Copy Assign (double) */ + +TEST(VectorDouble, copy_assign) +{ + Vector v2; + + { + const Vector v1 = {1.0, 2.0, 3.0}; + v2 = v1; + + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_EQ(v1[0], 1.0); + EXPECT_DOUBLE_EQ(v1[1], 2.0); + EXPECT_DOUBLE_EQ(v1[2], 3.0); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_EQ(v2[0], 1.0); + EXPECT_DOUBLE_EQ(v2[1], 2.0); + EXPECT_DOUBLE_EQ(v2[2], 3.0); + } + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_EQ(v2[0], 1.0); + EXPECT_DOUBLE_EQ(v2[1], 2.0); + EXPECT_DOUBLE_EQ(v2[2], 3.0); +} + +/* Move Construct (double) */ + +TEST(VectorDouble, move_construct) +{ + Vector v1 = {1.0, 2.0, 3.0}; + + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_EQ(v1[0], 1.0); + EXPECT_DOUBLE_EQ(v1[1], 2.0); + EXPECT_DOUBLE_EQ(v1[2], 3.0); + + const Vector v2 = std::move(v1); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_EQ(v2[0], 1.0); + EXPECT_DOUBLE_EQ(v2[1], 2.0); + EXPECT_DOUBLE_EQ(v2[2], 3.0); +} + +/* Move Assign (double) */ + +TEST(VectorDouble, move_assign) +{ + Vector v2; + + { + const Vector v1 = {1.0, 2.0, 3.0}; + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_EQ(v1[0], 1.0); + EXPECT_DOUBLE_EQ(v1[1], 2.0); + EXPECT_DOUBLE_EQ(v1[2], 3.0); + + v2 = std::move(v1); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_EQ(v2[0], 1.0); + EXPECT_DOUBLE_EQ(v2[1], 2.0); + EXPECT_DOUBLE_EQ(v2[2], 3.0); + } + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_EQ(v2[0], 1.0); + EXPECT_DOUBLE_EQ(v2[1], 2.0); + EXPECT_DOUBLE_EQ(v2[2], 3.0); +} + +/* Value Construct Modify (double) */ + +TEST(VectorDouble, value_construct_modify) +{ + Vector v = {1.0, 2.0, 3.0}; + ASSERT_EQ(v.size(), 3); + EXPECT_DOUBLE_EQ(v[0], 1.0); + EXPECT_DOUBLE_EQ(v[1], 2.0); + EXPECT_DOUBLE_EQ(v[2], 3.0); + + v[2] = 5.0; + ASSERT_EQ(v.size(), 3); + EXPECT_DOUBLE_EQ(v[0], 1.0); + EXPECT_DOUBLE_EQ(v[1], 2.0); + EXPECT_DOUBLE_EQ(v[2], 5.0); +} + +/* Size Construct Modify (double) */ + +TEST(VectorDouble, size_construct_modify) +{ + Vector v(5); + ASSERT_EQ(v.size(), 5); + + v[0] = 1.0; + v[1] = 2.0; + v[2] = 3.0; + v[3] = 4.0; + v[4] = 5.0; + + EXPECT_DOUBLE_EQ(v[0], 1.0); + EXPECT_DOUBLE_EQ(v[1], 2.0); + EXPECT_DOUBLE_EQ(v[2], 3.0); + EXPECT_DOUBLE_EQ(v[3], 4.0); + EXPECT_DOUBLE_EQ(v[4], 5.0); +} + +// ------------- // +// Vector // +// ------------- // + +TEST(VectorFloat, default_construct) +{ + const Vector v; + (void)v; +} + +TEST(VectorFloat, value_construct) +{ + const Vector v = {1.0, 2.0, 3.0}; + ASSERT_EQ(v.size(), 3); + EXPECT_FLOAT_EQ(v[0], 1.0); + EXPECT_FLOAT_EQ(v[1], 2.0); + EXPECT_FLOAT_EQ(v[2], 3.0); +} + +TEST(VectorFloat, size_construct) +{ + const Vector v(5); + ASSERT_EQ(v.size(), 5); +} + +TEST(VectorFloat, copy_construct) +{ + const Vector v1 = {1.0, 2.0, 3.0}; + const Vector v2 = v1; + + ASSERT_EQ(v1.size(), 3); + EXPECT_FLOAT_EQ(v1[0], 1.0); + EXPECT_FLOAT_EQ(v1[1], 2.0); + EXPECT_FLOAT_EQ(v1[2], 3.0); + + ASSERT_EQ(v2.size(), 3); + EXPECT_FLOAT_EQ(v2[0], 1.0); + EXPECT_FLOAT_EQ(v2[1], 2.0); + EXPECT_FLOAT_EQ(v2[2], 3.0); +} + +TEST(VectorFloat, copy_assign) +{ + Vector v2; + + { + const Vector v1 = {1.0, 2.0, 3.0}; + v2 = v1; + + ASSERT_EQ(v1.size(), 3); + EXPECT_FLOAT_EQ(v1[0], 1.0); + EXPECT_FLOAT_EQ(v1[1], 2.0); + EXPECT_FLOAT_EQ(v1[2], 3.0); + + ASSERT_EQ(v2.size(), 3); + EXPECT_FLOAT_EQ(v2[0], 1.0); + EXPECT_FLOAT_EQ(v2[1], 2.0); + EXPECT_FLOAT_EQ(v2[2], 3.0); + } + + ASSERT_EQ(v2.size(), 3); + EXPECT_FLOAT_EQ(v2[0], 1.0); + EXPECT_FLOAT_EQ(v2[1], 2.0); + EXPECT_FLOAT_EQ(v2[2], 3.0); +} + +TEST(VectorFloat, move_construct) +{ + Vector v1 = {1.0, 2.0, 3.0}; + + ASSERT_EQ(v1.size(), 3); + EXPECT_FLOAT_EQ(v1[0], 1.0); + EXPECT_FLOAT_EQ(v1[1], 2.0); + EXPECT_FLOAT_EQ(v1[2], 3.0); + + const Vector v2 = std::move(v1); + + ASSERT_EQ(v2.size(), 3); + EXPECT_FLOAT_EQ(v2[0], 1.0); + EXPECT_FLOAT_EQ(v2[1], 2.0); + EXPECT_FLOAT_EQ(v2[2], 3.0); +} + +TEST(VectorFloat, move_assign) +{ + Vector v2; + + { + const Vector v1 = {1.0, 2.0, 3.0}; + ASSERT_EQ(v1.size(), 3); + EXPECT_FLOAT_EQ(v1[0], 1.0); + EXPECT_FLOAT_EQ(v1[1], 2.0); + EXPECT_FLOAT_EQ(v1[2], 3.0); + + v2 = std::move(v1); + + ASSERT_EQ(v2.size(), 3); + EXPECT_FLOAT_EQ(v2[0], 1.0); + EXPECT_FLOAT_EQ(v2[1], 2.0); + EXPECT_FLOAT_EQ(v2[2], 3.0); + } + + ASSERT_EQ(v2.size(), 3); + EXPECT_FLOAT_EQ(v2[0], 1.0); + EXPECT_FLOAT_EQ(v2[1], 2.0); + EXPECT_FLOAT_EQ(v2[2], 3.0); +} + +TEST(VectorFloat, value_construct_modify) +{ + Vector v = {1.0, 2.0, 3.0}; + ASSERT_EQ(v.size(), 3); + EXPECT_FLOAT_EQ(v[0], 1.0); + EXPECT_FLOAT_EQ(v[1], 2.0); + EXPECT_FLOAT_EQ(v[2], 3.0); + + v[2] = 5.0; + ASSERT_EQ(v.size(), 3); + EXPECT_FLOAT_EQ(v[0], 1.0); + EXPECT_FLOAT_EQ(v[1], 2.0); + EXPECT_FLOAT_EQ(v[2], 5.0); +} + +TEST(VectorFloat, size_construct_modify) +{ + Vector v(5); + ASSERT_EQ(v.size(), 5); + + v[0] = 1.0; + v[1] = 2.0; + v[2] = 3.0; + v[3] = 4.0; + v[4] = 5.0; + + EXPECT_FLOAT_EQ(v[0], 1.0); + EXPECT_FLOAT_EQ(v[1], 2.0); + EXPECT_FLOAT_EQ(v[2], 3.0); + EXPECT_FLOAT_EQ(v[3], 4.0); + EXPECT_FLOAT_EQ(v[4], 5.0); +} + +// ---------------------------- // +// Vector> // +// ---------------------------- // + +TEST(VectorDoubleComplex, default_construct) +{ + const Vector> v; + (void)v; +} + +TEST(VectorDoubleComplex, value_construct) +{ + using namespace std::complex_literals; + const Vector> v = {1.0 + 4.0i, 2.0 + 5.0i, 3.0 + 6.0i}; + ASSERT_EQ(v.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[2], 3.0 + 6.0i); +} + +TEST(VectorDoubleComplex, size_construct) +{ + const Vector> v(5); + ASSERT_EQ(v.size(), 5); +} + +TEST(VectorDoubleComplex, copy_construct) +{ + using namespace std::complex_literals; + const Vector> v1 = {1.0 + 4.0i, 2.0 + 5.0i, 3.0 + 6.0i}; + const Vector> v2 = v1; + + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v1[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[2], 3.0 + 6.0i); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v2[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[2], 3.0 + 6.0i); +} + +TEST(VectorDoubleComplex, copy_assign) +{ + using namespace std::complex_literals; + Vector> v2; + + { + const Vector> v1 = {1.0 + 4.0i, 2.0 + 5.0i, 3.0 + 6.0i}; + v2 = v1; + + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v1[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[2], 3.0 + 6.0i); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v2[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[2], 3.0 + 6.0i); + } + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v2[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[2], 3.0 + 6.0i); +} + +TEST(VectorDoubleComplex, move_construct) +{ + using namespace std::complex_literals; + Vector> v1 = {1.0 + 4.0i, 2.0 + 5.0i, 3.0 + 6.0i}; + + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v1[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[2], 3.0 + 6.0i); + + const Vector> v2 = std::move(v1); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v2[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[2], 3.0 + 6.0i); +} + +TEST(VectorDoubleComplex, move_assign) +{ + using namespace std::complex_literals; + Vector> v2; + + { + const Vector> v1 = {1.0 + 4.0i, 2.0 + 5.0i, 3.0 + 6.0i}; + ASSERT_EQ(v1.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v1[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v1[2], 3.0 + 6.0i); + + v2 = std::move(v1); + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v2[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[2], 3.0 + 6.0i); + } + + ASSERT_EQ(v2.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v2[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v2[2], 3.0 + 6.0i); +} + +TEST(VectorDoubleComplex, value_construct_modify) +{ + using namespace std::complex_literals; + Vector> v = {1.0 + 4.0i, 2.0 + 5.0i, 3.0 + 6.0i}; + ASSERT_EQ(v.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[2], 3.0 + 6.0i); + + v[2] = 5.0; + ASSERT_EQ(v.size(), 3); + EXPECT_DOUBLE_COMPLEX_EQ(v[0], 1.0 + 4.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[1], 2.0 + 5.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[2], 5.0 + 0.0i); +} + +TEST(VectorDoubleComplex, size_construct_modify) +{ + using namespace std::complex_literals; + Vector> v(5); + ASSERT_EQ(v.size(), 5); + + v[0] = 1.0 + 6.0i; + v[1] = 2.0 + 7.0i; + v[2] = 3.0 + 8.0i; + v[3] = 4.0 + 9.0i; + v[4] = 5.0 + 10.0i; + + EXPECT_DOUBLE_COMPLEX_EQ(v[0], 1.0 + 6.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[1], 2.0 + 7.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[2], 3.0 + 8.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[3], 4.0 + 9.0i); + EXPECT_DOUBLE_COMPLEX_EQ(v[4], 5.0 + 10.0i); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/LinearAlgebra/vector_operations.cpp b/tests/LinearAlgebra/vector_operations.cpp new file mode 100644 index 00000000..b0a75551 --- /dev/null +++ b/tests/LinearAlgebra/vector_operations.cpp @@ -0,0 +1,117 @@ +#include + +#include "../../include/LinearAlgebra/vector.h" +#include "../../include/LinearAlgebra/vector_operations.h" + +/* bool equals(const Vector& lhs, const Vector& rhs); */ + +TEST(VectorOperations, equals_vector_vector) +{ + const Vector v = {1, 2, 3}; + const Vector v1 = {1, 2, 3}; + const Vector v2 = {1, 2, 3, 4}; + const Vector v3 = {1, 2}; + const Vector v4 = {1, 3, 3}; + + EXPECT_TRUE(equals(v, v)); + EXPECT_TRUE(equals(v, v1)); + + EXPECT_FALSE(equals(v, v2)); + EXPECT_FALSE(equals(v, v3)); + EXPECT_FALSE(equals(v, v4)); +} + +/* void assign(Vector& lhs, const T& value); */ + +TEST(VectorOperations, assign_vector_scalar) +{ + Vector v = {1, 2, 3}; + assign(v, 5.0); + const Vector expected_result = {5, 5, 5}; + EXPECT_TRUE(equals(v, expected_result)); +} + +/* void add(Vector& result, const Vector& x); */ + +TEST(VectorOperations, add_vector_vector) +{ + Vector v1 = {1, 2, 3}; + const Vector v2 = {-1, -5, 2}; + add(v1, v2); + const Vector expected_result = {0, -3, 5}; + EXPECT_TRUE(equals(v1, expected_result)); +} + +/* void subtract(Vector& result, const Vector& x) */ + +TEST(VectorOperations, subtract_vector_vector) +{ + Vector v1 = {1, 2, 3}; + const Vector v2 = {-1, -5, 2}; + subtract(v1, v2); + const Vector expected_result = {2, 7, 1}; + EXPECT_TRUE(equals(v1, expected_result)); +} + +/* void linear_combination(Vector& x, const T& alpha, const Vector& y, const T& beta); */ + +TEST(VectorOperations, linear_combination) +{ + Vector v1 = {1, 2, 3}; + const Vector v2 = {-1, -5, 2}; + const double alpha = -3.0; + const double beta = 2.0; + linear_combination(v1, alpha, v2, beta); + const Vector expected_result = {-5.0, -16.0, -5.0}; + EXPECT_TRUE(equals(v1, expected_result)); +} + +/* void multiply(Vector& x, const T& alpha); */ + +TEST(VectorOperations, multiply_vector_scalar) +{ + Vector v1 = {1, -2, 3}; + const double alpha = -3.0; + multiply(v1, alpha); + const Vector expected_result = {-3.0, 6.0, -9.0}; + EXPECT_TRUE(equals(v1, expected_result)); +} + +/* T dot_product(const Vector& lhs, const Vector& rhs); */ + +TEST(VectorOperations, dot_product) +{ + const Vector v1 = {1, 2, 3}; + const Vector v2 = {1, 5, 2}; + EXPECT_DOUBLE_EQ(dot_product(v1, v2), 17.0); +} + +/* T l1_norm(const Vector& x); */ + +TEST(VectorOperations, l1_vector_norm) +{ + const Vector v = {1, -5, 2}; + EXPECT_DOUBLE_EQ(l1_norm(v), 8.0); +} + +/* T l2_norm_squared(const Vector& x); */ + +TEST(VectorOperations, l2_vector_norm_squared) +{ + const Vector v = {1, -5, 2}; + EXPECT_DOUBLE_EQ(l2_norm_squared(v), 30.0); +} + +/* T infinity_norm(const Vector& x); */ + +TEST(VectorOperations, infinity_vector_norm) +{ + const Vector v = {1, -5, 2}; + EXPECT_DOUBLE_EQ(infinity_norm(v), 5.0); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/PolarGrid/polargrid.cpp b/tests/PolarGrid/polargrid.cpp new file mode 100644 index 00000000..cffece42 --- /dev/null +++ b/tests/PolarGrid/polargrid.cpp @@ -0,0 +1,260 @@ +#include +#include "../../include/PolarGrid/polargrid.h" + +TEST(PolarGridTest, DefaultConstructor) +{ + PolarGrid grid; +} + +TEST(PolarGridTest, VectorConstructor) +{ + std::vector radii = {0.1, 0.2, 0.5, 0.9, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + PolarGrid grid(radii, angles); +} + +TEST(PolarGridTest, NumberOfNodes) +{ + std::vector radii = {0.1, 0.2, 0.5, 0.9, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + PolarGrid grid(radii, angles); + ASSERT_EQ(grid.numberOfNodes(), radii.size() * (angles.size() - 1)); +} + +TEST(PolarGridTest, AccessorsTest) +{ + std::vector radii = {0.1, 0.2, 0.5, 0.9, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + PolarGrid grid(radii, angles); + ASSERT_DOUBLE_EQ(grid.radius(0), 0.1); + ASSERT_DOUBLE_EQ(grid.radius(1), 0.2); + ASSERT_DOUBLE_EQ(grid.radius(4), 1.3); + ASSERT_DOUBLE_EQ(grid.theta(0), 0); + ASSERT_DOUBLE_EQ(grid.theta(1), M_PI / 8); + ASSERT_DOUBLE_EQ(grid.theta(4), M_PI + M_PI / 8); +} + +TEST(PolarGridTest, GridJumpTest) +{ + std::vector radii = {0.1, 0.2, 0.5, 0.9, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double splitting_radius = 0.4; + PolarGrid grid(radii, angles, splitting_radius); + ASSERT_DOUBLE_EQ(grid.radius(0), 0.1); + ASSERT_DOUBLE_EQ(grid.radius(1), 0.2); + ASSERT_DOUBLE_EQ(grid.radius(4), 1.3); + ASSERT_DOUBLE_EQ(grid.theta(0), 0); + ASSERT_DOUBLE_EQ(grid.theta(1), M_PI / 8); + ASSERT_DOUBLE_EQ(grid.theta(4), M_PI + M_PI / 8); +} + +TEST(PolarGridTest, IndexingTest) +{ + std::vector radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double splitting_radius = 0.6; + PolarGrid grid(radii, angles, splitting_radius); + + for (int i = 0; i < grid.nr(); i++) { + for (int j = 0; j < grid.ntheta(); j++) { + MultiIndex alpha(i, j); + int node_index = grid.index(alpha); + MultiIndex beta = grid.multiIndex(node_index); + ASSERT_EQ(alpha[0], beta[0]); + ASSERT_EQ(alpha[1], beta[1]); + } + } + + for (int i = 0; i < grid.numberOfNodes(); i++) { + MultiIndex alpha = grid.multiIndex(i); + int node_index = grid.index(alpha); + ASSERT_EQ(node_index, i); + } +} + +TEST(PolarGridTest, IndexingValuesTest) +{ + std::vector radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double splitting_radius = 0.6; + PolarGrid grid(radii, angles, splitting_radius); + + { + MultiIndex alpha(2, 6); + int node_index = grid.index(alpha); + ASSERT_EQ(node_index, 22); + MultiIndex beta = grid.multiIndex(node_index); + ASSERT_EQ(alpha[0], beta[0]); + ASSERT_EQ(alpha[1], beta[1]); + } + + { + MultiIndex alpha(3, 2); + int node_index = grid.index(alpha); + ASSERT_EQ(node_index, 26); + MultiIndex beta = grid.multiIndex(node_index); + ASSERT_EQ(alpha[0], beta[0]); + ASSERT_EQ(alpha[1], beta[1]); + } + + { + MultiIndex alpha(6, 4); + int node_index = grid.index(alpha); + ASSERT_EQ(node_index, 54); + MultiIndex beta = grid.multiIndex(node_index); + ASSERT_EQ(alpha[0], beta[0]); + ASSERT_EQ(alpha[1], beta[1]); + } + + { + MultiIndex alpha(4, 7); + int node_index = grid.index(alpha); + ASSERT_EQ(node_index, 67); + MultiIndex beta = grid.multiIndex(node_index); + ASSERT_EQ(alpha[0], beta[0]); + ASSERT_EQ(alpha[1], beta[1]); + } +} + +TEST(PolarGridTest, CoordinatesTest) +{ + std::vector radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double splitting_radius = 0.6; + PolarGrid grid(radii, angles, splitting_radius); + + MultiIndex alpha(3, 2); + Point P1 = grid.polarCoordinates(alpha); + ASSERT_DOUBLE_EQ(P1[0], 0.5); + ASSERT_DOUBLE_EQ(P1[1], M_PI / 8); + + alpha[0] += 4; + alpha[1] -= 1; + P1 = grid.polarCoordinates(alpha); + ASSERT_DOUBLE_EQ(P1[0], 1.4); + ASSERT_DOUBLE_EQ(P1[1], M_PI / 16); +} + +TEST(PolarGridTest, NeighborDistanceTest) +{ + std::vector radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double splitting_radius = 0.6; + PolarGrid grid(radii, angles, splitting_radius); + + std::array, space_dimension> neighbor_distance; + { + MultiIndex alpha(3, 2); + grid.adjacentNeighborDistances(alpha, neighbor_distance); + ASSERT_DOUBLE_EQ(neighbor_distance[0].first, 0.5 - 0.25); + ASSERT_DOUBLE_EQ(neighbor_distance[0].second, 0.8 - 0.5); + ASSERT_DOUBLE_EQ(neighbor_distance[1].first, M_PI / 8 - M_PI / 16); + ASSERT_DOUBLE_EQ(neighbor_distance[1].second, M_PI / 2 - M_PI / 8); + } + + { + MultiIndex alpha(8, 7); + grid.adjacentNeighborDistances(alpha, neighbor_distance); + ASSERT_DOUBLE_EQ(neighbor_distance[0].first, 2.0 - 1.4); + ASSERT_DOUBLE_EQ(neighbor_distance[0].second, 0.0); + ASSERT_DOUBLE_EQ(neighbor_distance[1].first, M_PI / 2 - M_PI / 8); + ASSERT_DOUBLE_EQ(neighbor_distance[1].second, M_PI / 2); + } + + { + MultiIndex alpha(4, 0); + grid.adjacentNeighborDistances(alpha, neighbor_distance); + ASSERT_DOUBLE_EQ(neighbor_distance[0].first, 0.8 - 0.5); + ASSERT_DOUBLE_EQ(neighbor_distance[0].second, 0.9 - 0.8); + ASSERT_DOUBLE_EQ(neighbor_distance[1].first, M_PI / 2); + ASSERT_DOUBLE_EQ(neighbor_distance[1].second, M_PI / 16); + } + + { + MultiIndex alpha(0, 5); + grid.adjacentNeighborDistances(alpha, neighbor_distance); + ASSERT_DOUBLE_EQ(neighbor_distance[0].first, 0.0); + ASSERT_DOUBLE_EQ(neighbor_distance[0].second, 0.2 - 0.1); + ASSERT_NEAR(neighbor_distance[1].first, M_PI / 16, 1e-15); + ASSERT_NEAR(neighbor_distance[1].second, M_PI / 8 - M_PI / 16, 1e-15); + ASSERT_EQ(equals(neighbor_distance[1].first, M_PI / 16), true); + ASSERT_EQ(equals(neighbor_distance[1].second, M_PI / 8 - M_PI / 16), true); + } +} + +TEST(PolarGridTest, NeighborsTest) +{ + std::vector radii = {0.1, 0.2, 0.25, 0.5, 0.8, 0.9, 1.3, 1.4, 2.0}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + double splitting_radius = 0.6; + PolarGrid grid(radii, angles, splitting_radius); + + std::array, space_dimension> neighbors; + + { + MultiIndex alpha(3, 2); + grid.adjacentNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, 18); + ASSERT_EQ(neighbors[0].second, 42); + ASSERT_EQ(neighbors[1].first, 25); + ASSERT_EQ(neighbors[1].second, 27); + grid.diagonalNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, 17); + ASSERT_EQ(neighbors[0].second, 37); + ASSERT_EQ(neighbors[1].first, 19); + ASSERT_EQ(neighbors[1].second, 47); + } + + { + MultiIndex alpha(8, 7); + grid.adjacentNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, 70); + ASSERT_EQ(neighbors[0].second, -1); + ASSERT_EQ(neighbors[1].first, 66); + ASSERT_EQ(neighbors[1].second, 36); + grid.diagonalNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, 65); + ASSERT_EQ(neighbors[0].second, -1); + ASSERT_EQ(neighbors[1].first, 35); + ASSERT_EQ(neighbors[1].second, -1); + } + + { + MultiIndex alpha(4, 0); + grid.adjacentNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, 24); + ASSERT_EQ(neighbors[0].second, 33); + ASSERT_EQ(neighbors[1].first, 67); + ASSERT_EQ(neighbors[1].second, 37); + grid.diagonalNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, 31); + ASSERT_EQ(neighbors[0].second, 68); + ASSERT_EQ(neighbors[1].first, 25); + ASSERT_EQ(neighbors[1].second, 38); + } + + { + MultiIndex alpha(0, 5); + grid.adjacentNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, -1); + ASSERT_EQ(neighbors[0].second, 13); + ASSERT_EQ(neighbors[1].first, 4); + ASSERT_EQ(neighbors[1].second, 6); + grid.diagonalNeighborsOf(alpha, neighbors); + ASSERT_EQ(neighbors[0].first, -1); + ASSERT_EQ(neighbors[0].second, 12); + ASSERT_EQ(neighbors[1].first, -1); + ASSERT_EQ(neighbors[1].second, 14); + } +} + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/Residual/residual.cpp b/tests/Residual/residual.cpp new file mode 100644 index 00000000..64f235c2 --- /dev/null +++ b/tests/Residual/residual.cpp @@ -0,0 +1,158 @@ +#include + +#include +#include + +#include "../../include/GMGPolar/gmgpolar.h" + +#include "../../include/Residual/ResidualGive/residualGive.h" +#include "../../include/Residual/ResidualTake/residualTake.h" + +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" +#include "../../include/InputFunctions/boundaryConditions.h" +#include "../../include/InputFunctions/sourceTerm.h" +/* --------- */ +/* Test Case */ +/* --------- */ +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" + +namespace ResidualTest +{ +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); + std::uniform_real_distribution dist(-100.0, 100.0); + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace ResidualTest + +using namespace ResidualTest; + +/* Test 1/1: */ +/* Does the Take and Give Implementation match up? */ + +TEST(OperatorATest, applyA_DirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); + + ResidualGive residualGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residualTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + Vector x = generate_random_sample_data(level.grid(), 42); + Vector rhs = generate_random_sample_data(level.grid(), 69); + + Vector result_Give(level.grid().numberOfNodes()); + residualGive_operator.computeResidual(result_Give, rhs, x); + + Vector result_Take(level.grid().numberOfNodes()); + residualTake_operator.computeResidual(result_Take, rhs, x); + + ASSERT_EQ(result_Give.size(), result_Take.size()); + for (int index = 0; index < result_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(result_Give[index], result_Take[index], 1e-8); + else + ASSERT_NEAR(result_Give[index], result_Take[index], 1e-11); + } +} + +TEST(OperatorATest, applyA_AcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, false); + + ResidualGive residualGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualTake residualTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + Vector x = generate_random_sample_data(level.grid(), 42); + Vector rhs = generate_random_sample_data(level.grid(), 69); + + Vector result_Give(level.grid().numberOfNodes()); + residualGive_operator.computeResidual(result_Give, rhs, x); + + Vector result_Take(level.grid().numberOfNodes()); + residualTake_operator.computeResidual(result_Take, rhs, x); + + ASSERT_EQ(result_Give.size(), result_Take.size()); + for (int index = 0; index < result_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(result_Give[index], result_Take[index], 1e-8); + else + ASSERT_NEAR(result_Give[index], result_Take[index], 1e-11); + } +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/Smoother/smoother.cpp b/tests/Smoother/smoother.cpp new file mode 100644 index 00000000..4afe4be9 --- /dev/null +++ b/tests/Smoother/smoother.cpp @@ -0,0 +1,1441 @@ +#include + +#include +#include + +#include "../../include/GMGPolar/gmgpolar.h" + +#include "../../include/Residual/ResidualGive/residualGive.h" +#include "../../include/DirectSolver/DirectSolverGiveCustomLU/directSolverGiveCustomLU.h" +#include "../../include/Smoother/SmootherGive/smootherGive.h" +#include "../../include/Smoother/SmootherTake/smootherTake.h" + +#include "../../include/InputFunctions/domainGeometry.h" +#include "../../include/InputFunctions/densityProfileCoefficients.h" +#include "../../include/InputFunctions/boundaryConditions.h" +#include "../../include/InputFunctions/sourceTerm.h" +/* --------- */ +/* Test Case */ +/* --------- */ +#include "../include/InputFunctions/DomainGeometry/czarnyGeometry.h" +#include "../include/InputFunctions/BoundaryConditions/polarR6_Boundary_CzarnyGeometry.h" +#include "../include/InputFunctions/DensityProfileCoefficients/zoniShiftedCoefficients.h" +#include "../include/InputFunctions/SourceTerms/polarR6_ZoniShifted_CzarnyGeometry.h" + +#include + +namespace SmootherTest +{ +Vector generate_random_sample_data(const PolarGrid& grid, unsigned int seed) +{ + Vector x(grid.numberOfNodes()); + std::mt19937 gen(seed); + std::uniform_real_distribution dist(-100.0, 100.0); + for (int i = 0; i < x.size(); ++i) { + x[i] = dist(gen); + } + return x; +} +} // namespace SmootherTest + +using namespace SmootherTest; + +/* Test 1/2: */ +/* Does the Take and Give Implementation match up? */ + +TEST(SmootherTest, smoother_DirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + SmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smootherTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + Vector start = generate_random_sample_data(level.grid(), 24); + Vector temp = generate_random_sample_data(level.grid(), 8); + + Vector solution_Give = start; + smootherGive_operator.smoothing(solution_Give, rhs, temp); + + Vector solution_Take = start; + smootherTake_operator.smoothing(solution_Take, rhs, temp); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-11); + } +} + +TEST(SmootherTest, smoother_AcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + // "Take" requires cached values + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + SmootherGive smootherGive_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smootherTake_operator(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + Vector rhs = generate_random_sample_data(level.grid(), 69); + Vector start = generate_random_sample_data(level.grid(), 24); + Vector temp = generate_random_sample_data(level.grid(), 8); + + Vector solution_Give = start; + smootherGive_operator.smoothing(solution_Give, rhs, temp); + + Vector solution_Take = start; + smootherTake_operator.smoothing(solution_Take, rhs, temp); + + ASSERT_EQ(solution_Give.size(), solution_Take.size()); + for (int index = 0; index < solution_Give.size(); index++) { + MultiIndex alpha = level.grid().multiIndex(index); + if (alpha[0] == 0 && !DirBC_Interior) + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-8); + else + ASSERT_NEAR(solution_Give[index], solution_Take[index], 1e-10); + } +} + +/* Test 2/2: */ +/* Does the smoother converge to the directSolver solution? */ + +TEST(SmootherTest, SequentialSmootherDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, SequentialSmootherAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, SequentialSmootherDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > 1e-12) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 30); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + double precision = 1e-12; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 30); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, SequentialSmootherAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 80); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = false; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherGive smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 80); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +/* Using "Take" */ + +TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 300); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin) +{ + std::vector radii = {1e-5, 0.2, 0.25, 0.5, 0.8, 0.9, 0.95, 1.2, 1.3}; + std::vector angles = { + 0, M_PI / 16, M_PI / 8, M_PI / 2, M_PI, M_PI + M_PI / 16, M_PI + M_PI / 8, M_PI + M_PI / 2, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 600); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, SequentialSmootherTakeDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-12; + + while (infinity_norm(error) > 1e-12) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 30); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherTakeDirBC_Interior_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = true; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + double precision = 1e-12; + + while (infinity_norm(error) > precision) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 30); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, SequentialSmootherTakeAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 1; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 80); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +TEST(SmootherTest, ParallelSmootherTakeAcrossOrigin_SmallestGrid) +{ + std::vector radii = {1e-5, 0.2, 0.9, 1.2, 1.3}; + std::vector angles = {0, M_PI / 8, M_PI, M_PI + M_PI / 8, M_PI + M_PI}; + + double Rmax = radii.back(); + double kappa_eps = 0.3; + double delta_e = 1.4; + + CzarnyGeometry domain_geometry(Rmax, kappa_eps, delta_e); + + double alpha_jump = 0.7081 * Rmax; + std::unique_ptr coefficients = + std::make_unique(Rmax, alpha_jump); + std::unique_ptr boundary_conditions = + std::make_unique(Rmax, kappa_eps, delta_e); + std::unique_ptr source_term = + std::make_unique(Rmax, kappa_eps, delta_e); + + bool DirBC_Interior = false; + int maxOpenMPThreads = 16; + + bool cache_density_rpofile_coefficients = true; + bool cache_domain_geometry = true; + + auto grid = std::make_unique(radii, angles); + auto levelCache = std::make_unique(*grid, *coefficients, domain_geometry, + cache_density_rpofile_coefficients, cache_domain_geometry); + Level level(0, std::move(grid), std::move(levelCache), ExtrapolationType::NONE, 0); + + DirectSolverGiveCustomLU solver_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + ResidualGive residual_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + SmootherTake smoother_op(level.grid(), level.levelCache(), domain_geometry, *coefficients, DirBC_Interior, + maxOpenMPThreads); + + const Vector rhs = generate_random_sample_data(level.grid(), 42); + Vector discrete_solution = rhs; + solver_op.solveInPlace(discrete_solution); + + Vector temp(level.grid().numberOfNodes()); + Vector smoother_solution(level.grid().numberOfNodes()); + Vector error(level.grid().numberOfNodes()); + + smoother_solution = generate_random_sample_data(level.grid(), 69); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + + int iterations = 0; + bool max_iterations_reached = false; + const int max_iterations = 10000; + const double precision = 1e-8; + + while (infinity_norm(error) > 1e-8) { + smoother_op.smoothing(smoother_solution, rhs, temp); + +#pragma omp parallel for + for (int i = 0; i < error.size(); i++) { + error[i] = discrete_solution[i] - smoother_solution[i]; + } + iterations++; + if (iterations >= max_iterations) { + max_iterations_reached = true; + std::cerr << "Max iterations reached without convergence." << std::endl; + break; + } + } + + std::cout << "Convergence reached after " << iterations << " iterations." << std::endl; + + ASSERT_TRUE(!max_iterations_reached); + ASSERT_LT(iterations, 80); + ASSERT_NEAR(infinity_norm(error), 0.0, precision); +} + +int main(int argc, char* argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/comparetest.cpp b/tests/comparetest.cpp deleted file mode 100644 index 5c01b8c0..00000000 --- a/tests/comparetest.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include -#include -#include -#include "cmdline.h" -#include "gmgpolar.h" - -class Test_Parameters : public ::testing::Test -{ -protected: - void SetUp() override - { - //Results of the run with default parameters. - input.assign({5, 0, 0, 4, 4, 3, 0, 1, 0, 3136, 49, 64, 4, 12}); - - initparam = 9; - int initarr[initparam] = {Param::prob, Param::alpha_coeff, Param::beta_coeff, - Param::nr_exp, Param::ntheta_exp, Param::fac_ani, - Param::mod_pk, Param::DirBC_Interior, Param::divideBy2}; - data.resize(initparam); - std::copy(initarr, initarr + initparam, data.begin()); - - //Initializing default parameters - gyro::init_params(); - gyro::icntl[Param::verbose] = 0; - gyro::icntl[Param::debug] = 0; - gyro::icntl[Param::extrapolation] = 0; - gyro::icntl[Param::DirBC_Interior] = 1; - gyro::icntl[Param::check_error] = 1; - gyro::dcntl[Param::R0] = 1e-5; - gyro::f_grid_r = ""; - gyro::f_grid_theta = ""; - gyro::f_sol_in = ""; - gyro::f_sol_out = ""; - gyro::icntl[Param::nr_exp] = 4; - gyro::icntl[Param::ntheta_exp] = 4; - gyro::icntl[Param::fac_ani] = 3; - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], gyro::icntl[Param::beta_coeff], - gyro::icntl[Param::mod_pk], gyro::icntl[Param::prob]); - } - - int initparam; - std::vector input; - std::vector data; -}; - -TEST_F(Test_Parameters, Initialize_Parameters) -{ - for (int z = 0; z < initparam; z++) { - ASSERT_EQ(gyro::icntl[data[z]], input[z]) << "Initial data is not assigned properly"; - } -} - -TEST_F(Test_Parameters, DOF_on_finest_grid) -{ - gmgpolar gmgtest; - gmgtest.levels_orig = 1; // set levels_orig to prevent segfaulting in deconstructor. See issue #46. - gmgtest.create_grid_polar(); // only the finest grid is now created - EXPECT_EQ(gmgtest.v_level.size(), 1); - int nodes_r = gmgtest.v_level[0]->nr; - int nodes_theta = gmgtest.v_level[0]->ntheta; - int finest_nodes = nodes_r * nodes_theta; - EXPECT_EQ(finest_nodes, input[initparam]); - EXPECT_EQ(nodes_r, input[initparam + 1]); - EXPECT_EQ(nodes_theta, input[initparam + 2]); -} - -TEST_F(Test_Parameters, Test_multigrid_Iterations) -{ - gmgpolar gmgtest2; - gmgtest2.create_grid_polar(); - gmgtest2.polar_multigrid(); - - EXPECT_EQ(gmgtest2.levels, input[initparam + 3]); - int iterations = - gyro::icntl[Param::extrapolation] < 2 ? gmgtest2.nrm_2_res.size() - 1 : gmgtest2.nrm_2_err.size() - 1; - EXPECT_EQ(iterations, input[input.size() - 1]) << "Multigrid iterations do not match"; -} \ No newline at end of file diff --git a/tests/mockgrid.cpp b/tests/mockgrid.cpp deleted file mode 100644 index 4efe7a81..00000000 --- a/tests/mockgrid.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "mockgrid.h" -void create_grid(gmgpolar& test_p) -{ - time_t seed = 5000; - std::default_random_engine gen(seed); //deterministic seed to reproduce - std::uniform_real_distribution dis(gyro::dcntl[Param::R0], gyro::dcntl[Param::R]); - std::uniform_real_distribution theta_distribution(0, 2 * PI); - - std::cout << "creating randomized grid with std::default_random_engine seed " + std::to_string(seed) << std::endl; - level* new_level = new level(0); - new_level->nr = pow(2, gyro::icntl[Param::nr_exp]); - new_level->r = std::vector(new_level->nr + 1); - - std::vector rands(new_level->nr - 1); - for (int j = 0; j < new_level->nr - 1; ++j) { - rands[j] = dis(gen); - } - std::sort(rands.begin(), rands.end()); - new_level->r[0] = gyro::dcntl[Param::R0]; - for (int i = 1; i < new_level->nr; i++) { - new_level->r[i] = rands[i - 1]; //random grid on coarser level - } - new_level->r[new_level->nr] = gyro::dcntl[Param::R]; - new_level->nr++; - int ntmp = pow(2, ceil(log2(new_level->nr))); - new_level->ntheta = gyro::icntl[Param::periodic] ? ntmp : ntmp + 1; - - new_level->theta = std::vector(new_level->ntheta); - - std::vector randst(ntmp - 1); - for (int k = 0; k < ntmp - 1; ++k) { - randst[k] = theta_distribution(gen); - } - std::sort(randst.begin(), randst.end()); - new_level->theta[0] = 0; - for (int i = 1; i < ntmp; i++) { - new_level->theta[i] = randst[i - 1]; - } - if (!gyro::icntl[Param::periodic]) { - new_level->theta[ntmp] = 2 * PI; - } - - new_level->ntheta_int = gyro::icntl[Param::periodic] ? new_level->ntheta : new_level->ntheta - 1; - new_level->nr_int = new_level->nr - 1; - - new_level->thetaplus = std::vector(new_level->ntheta_int); - for (int k = 0; k < new_level->ntheta_int - 1; k++) { - new_level->thetaplus[k] = new_level->theta[k + 1] - new_level->theta[k]; - } - new_level->thetaplus[new_level->ntheta_int - 1] = 2 * PI - new_level->theta[new_level->ntheta_int - 1]; - - new_level->hplus = std::vector(new_level->nr_int); - for (int k = 0; k < new_level->nr_int; k++) { - new_level->hplus[k] = new_level->r[k + 1] - new_level->r[k]; - } - - level* coarser_level = new level(1); - coarser_level->nr = pow(2, gyro::icntl[Param::nr_exp] - 1) + 1; - ntmp = pow(2, ceil(log2(coarser_level->nr))); - coarser_level->ntheta = gyro::icntl[Param::periodic] ? ntmp : ntmp + 1; - - coarser_level->ntheta_int = gyro::icntl[Param::periodic] ? coarser_level->ntheta : coarser_level->ntheta - 1; - coarser_level->nr_int = coarser_level->nr - 1; - test_p.v_level.push_back(new_level); - test_p.v_level.push_back(coarser_level); - test_p.levels_orig = 2; -} \ No newline at end of file diff --git a/tests/mockgrid.h b/tests/mockgrid.h deleted file mode 100644 index 0d000a14..00000000 --- a/tests/mockgrid.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "gmgpolar.h" -#include -#include -#include - -#ifndef MOCKGRID_H - #define MOCKGRID_H - -void create_grid(gmgpolar& test_p); - -#endif \ No newline at end of file diff --git a/tests/test_prolongation.cpp b/tests/test_prolongation.cpp deleted file mode 100644 index a78f4f1a..00000000 --- a/tests/test_prolongation.cpp +++ /dev/null @@ -1,299 +0,0 @@ -#include -#include -#include "gmgpolar.h" -#include "mockgrid.h" -class test_prolongation - : public ::testing::TestWithParam< - std::tuple> //tuple includes data on grid size and Dirichlet boundary conditions -{ -protected: - void SetUp() override - { - //initialize default parameters. - gyro::init_params(); - gyro::icntl[Param::verbose] = 0; - gyro::dcntl[Param::R0] = 1e-5; - gyro::icntl[Param::periodic] = 1; - gyro::f_grid_r = ""; - gyro::f_grid_theta = ""; - gyro::f_sol_in = ""; - gyro::f_sol_out = ""; - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], gyro::icntl[Param::beta_coeff], - gyro::icntl[Param::mod_pk], gyro::icntl[Param::prob]); - } -}; - -/*! - * \brief Test the bilinear prolongation operator used in the multigrid cycle coarse-grid correction. - * - * The Test creates an arbitrary grid-function on the coarser level and prolongates it. - * On the fine level we iterate over all nodes and test the result based on whether the node is fine in theta, r or in both. - * - * Parametrized tests are used to test for different grid sizes and with or without Dirichlet boundary conditions. - */ - -TEST_P(test_prolongation, test_bilinear_prolongation) -{ - //we vary the grid size to guarantee that the problem works for all sizes - gyro::icntl[Param::nr_exp] = (int)(std::get<0>(GetParam()) / 3) + 3; - gyro::icntl[Param::ntheta_exp] = (std::get<0>(GetParam()) % 3) + 3; - gyro::icntl[Param::DirBC_Interior] = std::get<1>(GetParam()); - - gmgpolar test_p; - create_grid(test_p); - - level& p_level = *(test_p.v_level[0]); - int ctheta_int = test_p.v_level[1]->ntheta_int; //number of coarse nodes in theta direction - - p_level.m = test_p.v_level[0]->nr * test_p.v_level[0]->ntheta; //fine grid size - p_level.mc = test_p.v_level[1]->nr * test_p.v_level[1]->ntheta; //coarser grid size - - std::vector u_test(p_level.mc); - for (int z = 0; z < p_level.mc; z++) { - u_test[z] = - 1 - z + - pow(PI, - -z * z); //constructing arbitrary grid-function on coarse level to test our prolongation operator with. - } - - std::vector sol = - p_level.apply_prolongation_bi(u_test); //apply prolongation operator on arbitrary grid-function - - for (int j = 0; j < p_level.nr_int + 1; j++) { - for (int i = 0; i < p_level.ntheta_int; i++) { - if (j % 2 == 0 && i % 2 == 0) { //testing coarse node injection - EXPECT_EQ(u_test[(j / 2) * ctheta_int + (i / 2)], sol[j * p_level.ntheta_int + i]) - << "coarse node injection is failing"; - } - else if (i % 2 != 0 && j % 2 == 0) { - // as numbering in angle (theta_i) is odd, we have a fine node with - // coarse neighbors at (r_j, theta_i - k_{i-1}) and (r_j, theta_i + k_i) - - double k_qm1 = p_level.theta[i] - p_level.theta[i - 1]; //calculate k_{q-1} - double k_q = (i < p_level.ntheta_int - 1) ? p_level.theta[i + 1] - p_level.theta[i] - : 2 * PI - p_level.theta[i]; //k_q - - int i1 = (j / 2) * ctheta_int + (i - 1) / 2; //bottom coarse node in theta - int i2 = (i < p_level.ntheta_int - 1) ? i1 + 1 : (j / 2) * ctheta_int; //top coarse node in theta - - double val = (k_q * u_test[i1] + k_qm1 * u_test[i2]); - - EXPECT_NEAR(val, (k_q + k_qm1) * sol[j * p_level.ntheta_int + i], - 1e-12) //compare values as in the paper - << "Bilinear Prolongation fails for Index (r,theta) : (" + std::to_string(j) + "," + - std::to_string(i) + ")"; - ; - } - else if (i % 2 == 0 && j % 2 != 0) { - // as numbering in radius (r_j) is odd, we have a fine node with - // coarse neighbors at (r_j - h_{j-1}, theta_i) and (r_j+h_j, theta_i ) - double h_pm1 = p_level.r[j] - p_level.r[j - 1]; //h_{p-1} - double h_p = p_level.r[j + 1] - p_level.r[j]; //h_p - - double v1 = u_test[(j - 1) / 2 * ctheta_int + (i / 2)]; // left coarse node in r - double v2 = u_test[(j + 1) / 2 * ctheta_int + (i / 2)]; // right coarse node in r - - double val = (h_p * v1 + h_pm1 * v2); - - EXPECT_NEAR(val, (h_p + h_pm1) * sol[j * p_level.ntheta_int + i], 1e-12) //compare values - << "Bilinear Prolongation fails for Index (r,theta) : (" + std::to_string(j) + "," + - std::to_string(i) + ")"; - ; - } - else // both are fine nodes - { - double h_pm1 = p_level.r[j] - p_level.r[j - 1]; - double h_p = p_level.r[j + 1] - p_level.r[j]; - - double k_qm1 = p_level.theta[i] - p_level.theta[i - 1]; - double k_q = - (i < p_level.ntheta_int - 1) ? p_level.theta[i + 1] - p_level.theta[i] : 2 * PI - p_level.theta[i]; - - /*the stencil-corners corresponding to the values (r_j,theta_i)*/ - /*bottom corresponds to lower indices in theta direction. left to lower indices in radius direction*/ - - double bottom_left; - double top_left; - double bottom_right; - double top_right; - ASSERT_NE(p_level.nr_int - 1, 1); - - if (i < p_level.ntheta - 1) { - bottom_left = u_test[((j - 1) / 2) * ctheta_int + (i - 1) / 2]; - top_left = u_test[((j - 1) / 2) * ctheta_int + (i + 1) / 2]; - bottom_right = u_test[((j + 1) / 2) * ctheta_int + (i - 1) / 2]; - top_right = u_test[((j + 1) / 2) * ctheta_int + (i + 1) / 2]; - } - else { - bottom_left = u_test[((j - 1) / 2) * ctheta_int + (i - 1) / 2]; - top_left = u_test[((j - 1) / 2) * ctheta_int]; - bottom_right = u_test[((j + 1) / 2) * ctheta_int + (i - 1) / 2]; - top_right = u_test[((j + 1) / 2) * ctheta_int]; - } - - double val = ((h_p * k_q * bottom_left) + (h_p * k_qm1 * top_left) + (h_pm1 * k_q * bottom_right) + - (h_pm1 * k_qm1 * top_right)); //calculate value as in the paper - - EXPECT_NEAR(val, (h_p + h_pm1) * (k_q + k_qm1) * sol[j * p_level.ntheta_int + i], 1e-12) - << "Bilinear Prolongation fails for Index (r,theta) : (" + std::to_string(j) + "," + - std::to_string(i) + ")"; - } - } - } -} - -/*! - * \brief Test the injection prolongation operator used in the implicit extrapolation step of the multigrid-cycle. - * - * The Test creates an arbitrary grid-function on the coarser level and injects it. - * On the fine level we iterate over all nodes and test the result based on whether the node is fine or not. - * - * Parametrized tests are used to test for different grid sizes and with or without Dirichlet boundary conditions. - */ - -TEST_P(test_prolongation, test_injection_prolongation) -{ - gyro::icntl[Param::nr_exp] = (int)(std::get<0>(GetParam()) / 3) + 3; - gyro::icntl[Param::ntheta_exp] = (std::get<0>(GetParam()) % 3) + 3; - gyro::icntl[Param::DirBC_Interior] = std::get<1>(GetParam()); - - gmgpolar test_p; - - create_grid(test_p); - - level& p_level = *(test_p.v_level[0]); - int ctheta_int = test_p.v_level[1]->ntheta_int; // number of coarse nodes in theta direction - - p_level.m = test_p.v_level[0]->nr * test_p.v_level[0]->ntheta; // fine grid size - p_level.mc = test_p.v_level[1]->nr * test_p.v_level[1]->ntheta; // coarser grid size - - std::vector u_test(p_level.mc); - for (int z = 0; z < p_level.mc; z++) { - u_test[z] = - 1 - z + - pow(PI, - -z * z); //constructing arbitrary grid-function on coarse level to test our prolongation operator with. - } - - std::vector sol = p_level.apply_prolongation_inj(u_test); - - EXPECT_EQ((int)sol.size(), p_level.m); - //testing the embedding. since we embed the coarse gird function, the values of the fine node should be zero - for (int j = 0; j < p_level.nr_int + 1; j++) { - for (int i = 0; i < p_level.ntheta_int; i++) { - if (j % 2 == 0 && i % 2 == 0) { - EXPECT_EQ(u_test[(j / 2) * ctheta_int + (i / 2)], sol[j * p_level.ntheta_int + i]) - << "The Injection value fails at Index (r,theta): (" + std::to_string(j) + "," + std::to_string(i) + - ")"; - } - else { - EXPECT_EQ(sol[j * p_level.ntheta_int + i], 0); //fine nodes set to zero. - } - } - } -} -/*! - * \brief Test the extrapolation prolongation operator used in the implicit extrapolation step of the multigrid-cycle. - * - * The Test creates an arbitrary grid-function on the coarser level and prolongates it. - * On the fine level we iterate over all nodes and test the result based on whether the node is fine in theta, r or in both. - * The value is determined by a Triangulation of the grid on the coarser level. - * - * Parametrized tests are used to test for different grid sizes and with or without Dirichlet boundary conditions. - */ - -TEST_P(test_prolongation, test_extrapolation_prolongation) -{ - gyro::icntl[Param::nr_exp] = (int)(std::get<0>(GetParam()) / 3) + 3; - gyro::icntl[Param::ntheta_exp] = (std::get<0>(GetParam()) % 3) + 3; - gyro::icntl[Param::DirBC_Interior] = std::get<1>(GetParam()); - - gmgpolar test_p; - - create_grid(test_p); - - level& p_level = *(test_p.v_level[0]); - int ctheta_int = test_p.v_level[1]->ntheta_int; // number of coarse nodes in theta direction - - p_level.m = test_p.v_level[0]->nr * test_p.v_level[0]->ntheta; // number of nodes on fine level - p_level.mc = test_p.v_level[1]->nr * test_p.v_level[1]->ntheta; // number of nodes on coarse level - - std::vector u_test(p_level.mc); - for (int z = 0; z < p_level.mc; z++) { - u_test[z] = - 1 - z + - pow(PI, - -z * z); //constructing arbitrary grid-function on coarse level to test our prolongation operator with. - } - std::vector sol = p_level.apply_prolongation_ex(u_test); - - for (int j = 0; j < p_level.nr_int + 1; j++) { - for (int i = 0; i < p_level.ntheta_int; i++) { - if (j % 2 == 0 && i % 2 == 0) { //coarse node injection - EXPECT_EQ(u_test[(j / 2) * ctheta_int + (i / 2)], sol[j * p_level.ntheta_int + i]) - << "coarse node injection is failing"; - } - else if (i % 2 != 0 && j % 2 == 0) { - // as numbering in angle (theta_i) is odd, we have a fine node with - // coarse neighbors at (r_j, theta_i - k_{i-1}) and (r_j, theta_i + k_i) - - int i1 = (j / 2) * ctheta_int + (i - 1) / 2; // bottom coarse node in theta - int i2 = (i < p_level.ntheta_int - 1) ? i1 + 1 : (j / 2) * ctheta_int; // top coarse node in theta - - double val = 0.5 * (u_test[i1] + u_test[i2]); - - EXPECT_NEAR(val, sol[j * p_level.ntheta_int + i], 1e-12) - << "Extrapolated Prolongation fails for Index (r,theta): (" + std::to_string(j) + "," + - std::to_string(i) + ")"; - } - else if (i % 2 == 0 && j % 2 != 0) { - // as numbering in radius (r_j) is odd, we have a fine node with - // coarse neighbors at (r_j - h_{j-1}, theta_i) and (r_j+h_j, theta_i ) - - double v1 = u_test[(j - 1) / 2 * ctheta_int + (i / 2)]; // left coarse node in r - double v2 = u_test[(j + 1) / 2 * ctheta_int + (i / 2)]; // right coarse node in r - - double val = 0.5 * (v1 + v2); - - EXPECT_NEAR(val, sol[j * p_level.ntheta_int + i], 1e-12) - << "Extrapolated Prolongation fails for Index (r,theta): (" + std::to_string(j) + "," + - std::to_string(i) + ")"; - } - else // both are fine nodes - { - - /*in the triangulation we now consider that the fine node is on the hypothenuse of the triangle. - The corresponding coarse nodes are located on the triangles nodes that span the hypothenuse */ - - double top_left; - double bottom_right; - - if (i < p_level.ntheta_int - 1) { - top_left = u_test[((j - 1) / 2) * ctheta_int + (i + 1) / 2]; - bottom_right = u_test[((j + 1) / 2) * ctheta_int + (i - 1) / 2]; - } - else { - top_left = u_test[((j - 1) / 2) * ctheta_int]; - bottom_right = u_test[((j + 1) / 2) * ctheta_int + (i - 1) / 2]; - } - - double val = 0.5 * (top_left + bottom_right); - - EXPECT_NEAR(val, sol[j * p_level.ntheta_int + i], 1e-12) - << "Extrapolated Prolongation fails for Index (r,theta): (" + std::to_string(j) + "," + - std::to_string(i) + ")"; - ; - } - } - } -} - -INSTANTIATE_TEST_SUITE_P(Prolongation_size, test_prolongation, - ::testing::Values(std::make_tuple(0, false), std::make_tuple(1, false), - std::make_tuple(2, false), std::make_tuple(3, false), - std::make_tuple(4, false), std::make_tuple(5, false), - std::make_tuple(6, false), std::make_tuple(7, false), - std::make_tuple(8, false), std::make_tuple(0, true), - std::make_tuple(1, true), std::make_tuple(2, true), std::make_tuple(3, true), - std::make_tuple(4, true), std::make_tuple(5, true), std::make_tuple(6, true), - std::make_tuple(7, true), std::make_tuple(8, true))); \ No newline at end of file diff --git a/tests/test_restriction.cpp b/tests/test_restriction.cpp deleted file mode 100644 index 479d2dc8..00000000 --- a/tests/test_restriction.cpp +++ /dev/null @@ -1,295 +0,0 @@ -#include -#include "gmgpolar.h" -#include "mockgrid.h" -class test_restriction : public ::testing::TestWithParam> -{ -protected: - void SetUp() override - { - //initialize default parameters. - gyro::init_params(); - gyro::icntl[Param::verbose] = 0; - gyro::dcntl[Param::R0] = 1e-5; - gyro::f_grid_r = ""; - gyro::f_grid_theta = ""; - gyro::f_sol_in = ""; - gyro::f_sol_out = ""; - gyro::select_functions_class(gyro::icntl[Param::alpha_coeff], gyro::icntl[Param::beta_coeff], - gyro::icntl[Param::mod_pk], gyro::icntl[Param::prob]); - } -}; -/*! - * \brief Test the bilinear restriction operator used in the multigrid cycle coarse-grid correction. - * - * The test creates an arbitrary grid-function on the finer level and restricts it to the coarser level. - * On the coarse level we iterate over all nodes and accumulate the adjacent fine node values. - * This is matrix-free but it corresponds to applying the transposed prolongation matrix - * - * Parametrized tests are used to test for different grid sizes and with or without Dirichlet boundary conditions. - */ - -TEST_P(test_restriction, test_bilinear_restriction) -{ - gyro::icntl[Param::nr_exp] = (int)(std::get<0>(GetParam()) / 3) + 3; - gyro::icntl[Param::ntheta_exp] = (std::get<0>(GetParam()) % 3) + 3; - gyro::icntl[Param::DirBC_Interior] = std::get<1>(GetParam()); - - gmgpolar test_p; - - create_grid(test_p); //Mocking create_grid_polar, check_geom and define_coarse_nodes - - level& p_level = *(test_p.v_level[0]); - int ctheta_int = test_p.v_level[1]->ntheta_int; // number of coarse nodes in theta direction - int cr_int = test_p.v_level[1]->nr_int; - - p_level.m = test_p.v_level[0]->nr * test_p.v_level[0]->ntheta; //fine grid size - p_level.mc = test_p.v_level[1]->nr * test_p.v_level[1]->ntheta; //coarser grid size - - std::vector u_test(p_level.m); - for (int z = 0; z < p_level.m; z++) { - u_test[z] = - 1 - z + - pow(PI, - -z * z); //constructing arbitrary grid-function on coarse level to test our prolongation operator with. - } - - std::vector sol = p_level.apply_restriction_bi(u_test); - - /* - * The restriction operator accumulates the values in the direct vicinity and stores them in the corresponding node. - * These values are the eight fine nodes' value in the vicinity that are to be accumulated in the coarse node. - * - * We treat values in r as the x-axis. values in theta as the y-axis. Hence the vector 'adjacent' stores the values in the order: - * bottom_left, left, top_left, bottom, top, bottom_right, right, top_right, i.e. - * ^ --- 2 --- 4 --- 7 - * | --- 1 --- x --- 6 - * theta --- 0 --- 3 --- 5 - * | ------- r ------> - */ - - for (int j = 0; j < cr_int + 1; j++) { - for (int i = 0; i < ctheta_int; i++) { - std::vector adjacent(8, -1.0); - if (j == 0) { // innermost circle: nodes to the left (lower in radii indices) disappear - adjacent[0] = 0.0; - adjacent[1] = 0.0; - adjacent[2] = 0.0; - } - if (j == cr_int) { // outermost circle: nodes to the right disappear - adjacent[5] = 0.0; - adjacent[6] = 0.0; - adjacent[7] = 0.0; - } - - int k = 0; - // Store h_j,h_j-1 and k_i, k_i-1 for all adjacent nodes in the order as given above - std::vector> h_p(8, {-1, -1}); // (h_p, h_{p-1}) relative grid sizes - std::vector> k_q(8, {-1, -1}); // (k_q, k_{q-1}) - // z and y represent relative positions to the coarse node. e.g. if (z,y)=(-1,1) then we consider the fine node to the top-left - for (int z = -1; z < 2; z++) { - for (int y = -1; y < 2; y++) { - if (z != 0 || y != 0) { - if (adjacent[k] != 0.0) { - - adjacent[k] = - u_test[(2 * j + z) * p_level.ntheta_int + - ((i != 0 || y > -1) - ? (2 * i + y) - : p_level.ntheta_int - - 1)]; //adjacent value. consider periodic boundary in theta direction - - h_p[k] = {p_level.r[2 * j + z + 1] - p_level.r[2 * j + z], - p_level.r[2 * j + z] - - p_level.r[2 * j + z - 1]}; //distance in r coordinate for the adjacent node - - //to calculate k_q,k_{q-1} we consider the special case i=0 (2*i+y=y) separately. - if (i > 0) { - double indx = - (2 * i + y < p_level.ntheta_int - 1) ? p_level.theta[2 * i + y + 1] : 2 * PI; - - k_q[k] = {indx - p_level.theta[2 * i + y], - p_level.theta[2 * i + y] - p_level.theta[2 * i + y - 1]}; - } - else { - if (y == - 1) { //based on the value of y and periodic boundary conditions we get different values for {k_q,k_{q-1}} - k_q[k] = {p_level.theta[2] - p_level.theta[1], p_level.theta[1] - p_level.theta[0]}; - } - else if (y == 0) { - k_q[k] = {p_level.theta[1] - p_level.theta[0], - 2 * PI - p_level.theta[p_level.ntheta_int - 1]}; - } - else { - k_q[k] = {2 * PI - p_level.theta[p_level.ntheta_int - 1], - p_level.theta[p_level.ntheta_int - 1] - - p_level.theta[p_level.ntheta_int - 2]}; - } - } - } - k += 1; - } - } - } - /*values given by the operator. We multiply this with the grid-function value of the corresponding adjacent node*/ - - std::vector coeffs_hk{ - std::get<1>(h_p[0]) * std::get<1>(k_q[0]) / - ((std::get<0>(h_p[0]) + std::get<1>(h_p[0])) * (std::get<0>(k_q[0]) + std::get<1>(k_q[0]))), - std::get<1>(h_p[1]) / (std::get<0>(h_p[1]) + std::get<1>(h_p[1])), - std::get<1>(h_p[2]) * std::get<0>(k_q[2]) / - ((std::get<0>(h_p[2]) + std::get<1>(h_p[2])) * (std::get<0>(k_q[2]) + std::get<1>(k_q[2]))), - std::get<1>(k_q[3]) / (std::get<0>(k_q[3]) + std::get<1>(k_q[3])), - std::get<0>(k_q[4]) / (std::get<0>(k_q[4]) + std::get<1>(k_q[4])), - std::get<0>(h_p[5]) * std::get<1>(k_q[5]) / - ((std::get<0>(h_p[5]) + std::get<1>(h_p[5])) * (std::get<0>(k_q[5]) + std::get<1>(k_q[5]))), - std::get<0>(h_p[6]) / (std::get<0>(h_p[6]) + std::get<1>(h_p[6])), - std::get<0>(h_p[7]) * std::get<0>(k_q[7]) / - ((std::get<0>(h_p[7]) + std::get<1>(h_p[7])) * (std::get<0>(k_q[7]) + std::get<1>(k_q[7])))}; - - double finval = u_test[(2 * j) * p_level.ntheta_int + (2 * i)]; - for (int z = 0; z < 8; z++) { - finval += coeffs_hk[z] * adjacent[z]; //accumulate all values in the coarse node - } - EXPECT_NEAR(finval, sol[j * ctheta_int + i], 1e-10) - << "The test fails at Index for (r,theta): (" + std::to_string(j) + "," + std::to_string(i) + ")"; - } - } -} - -/*! - * \brief Test the injection restriction operator used in the implicit extrapolation step of the multigrid cycle. - * - * The Test creates an arbitrary grid-function on the finer level and restricts it. - * In this case this just corresponds to projecting the grid-function onto the coarse level. - * - * Parametrized tests are used to test for different grid sizes and with or without Dirichlet boundary conditions. - */ - -TEST_P(test_restriction, test_injection_restriction) -{ - gyro::icntl[Param::nr_exp] = (int)(std::get<0>(GetParam()) / 3) + 3; - gyro::icntl[Param::ntheta_exp] = (std::get<0>(GetParam()) % 3) + 3; - gyro::icntl[Param::DirBC_Interior] = std::get<1>(GetParam()); - - gmgpolar test_p; - - create_grid(test_p); - - level& p_level = *(test_p.v_level[0]); - int ctheta_int = test_p.v_level[1]->ntheta_int; - int cr_int = test_p.v_level[1]->nr_int; - - p_level.m = test_p.v_level[0]->nr * test_p.v_level[0]->ntheta; //number of nodes on fine level - p_level.mc = test_p.v_level[1]->nr * test_p.v_level[1]->ntheta; //number of nodes on coarse level - - std::vector u_test(p_level.m); - for (int z = 0; z < p_level.m; z++) { - u_test[z] = - 1 - z + - pow(PI, - -z * z); //constructing arbitrary grid-function on coarse level to test our prolongation operator with. - } - - std::vector sol = p_level.apply_restriction_inj(u_test); - - EXPECT_EQ((int)sol.size(), p_level.mc); - - for (int j = 0; j < cr_int + 1; j++) { - for (int i = 0; i < ctheta_int; i++) { - EXPECT_EQ(sol[j * ctheta_int + i], u_test[(2 * j) * p_level.ntheta_int + (2 * i)]) - << "The injection restriction fails at Index (r,theta): (" + std::to_string(j) + "," + - std::to_string(i) + ")"; //test all values - } - } -} - -/*! - * \brief Test the extrapolation restriction operator used in the implicit extrapolation step of the multigrid cycle. - * - * The Test creates an arbitrary grid-function on the finer level and restricts it. - * On the coarse level we iterate over all nodes and accumulate the adjacent fine node values based on the triangulation. - * We hence only consider 6 adjacent fine nodes, which lie on one of the edges spanned by the corresponding coarse node. - * This is matrix-free but it corresponds to applying the transposed prolongation matrix - * - * Parametrized tests are used to test for different grid sizes and with or without Dirichlet boundary conditions. - */ - -TEST_P(test_restriction, test_extrapolation_restriction) -{ - gyro::icntl[Param::nr_exp] = (int)(std::get<0>(GetParam()) / 3) + 3; - gyro::icntl[Param::ntheta_exp] = (std::get<0>(GetParam()) % 3) + 3; - gyro::icntl[Param::DirBC_Interior] = std::get<1>(GetParam()); - - gmgpolar test_p; - - create_grid(test_p); - - level& p_level = *(test_p.v_level[0]); - int ctheta_int = test_p.v_level[1]->ntheta_int; - int cr_int = test_p.v_level[1]->nr_int; - - p_level.m = test_p.v_level[0]->nr * test_p.v_level[0]->ntheta; //number of nodes on fine level - p_level.mc = test_p.v_level[1]->nr * test_p.v_level[1]->ntheta; //number of nodes on coarse level - - std::vector u_test(p_level.m); - for (int z = 0; z < p_level.mc; z++) { - u_test[z] = - 1 - z + - pow(PI, - -z * z); //constructing arbitrary grid-function on coarse level to test our prolongation operator with. - } - - std::vector sol = p_level.apply_restriction_ex(u_test); - - /* based on the triangulation, at most 6 adjacent fine nodes are considered: - * **left,top_left,bottom,top,bottom_right,right** - */ - for (int j = 0; j < cr_int + 1; j++) { - for (int i = 0; i < ctheta_int; i++) { - std::vector adjacent(6, -1.0); - if (j == 0) { // innermost circle - adjacent[0] = 0.0; - adjacent[1] = 0.0; - } - if (j == cr_int) { // outermost circle - adjacent[4] = 0.0; - adjacent[5] = 0.0; - } - - int k = 0; - //relative values of the fine nodes as in bilinear restriction - for (int z = -1; z < 2; z++) { - for (int y = -1; y < 2; y++) { - if ((z != 0 || y != 0) && (z * y != 1)) { - if (adjacent[k] != 0.0) { - - adjacent[k] = u_test[(2 * j + z) * p_level.ntheta_int + - ((i != 0 || y > -1) ? (2 * i + y) : p_level.ntheta_int - 1)]; - } - k += 1; - } - } - } - - double finval = u_test[(2 * j) * p_level.ntheta_int + (2 * i)]; - for (int z = 0; z < 6; z++) { - finval += - 0.5 * - adjacent[z]; // accumulate the values. the vector "coeffs_hk" reduces to 1/2 for every adjacent fine node - } - - EXPECT_NEAR(finval, sol[j * ctheta_int + i], 1e-12) - << "The test fails at Index for (r,theta): (" + std::to_string(j) + "," + std::to_string(i) + ")"; - } - } -} - -INSTANTIATE_TEST_SUITE_P(Restriction_size, test_restriction, - ::testing::Values(std::make_tuple(0, false), std::make_tuple(1, false), - std::make_tuple(2, false), std::make_tuple(3, false), - std::make_tuple(4, false), std::make_tuple(5, false), - std::make_tuple(6, false), std::make_tuple(7, false), - std::make_tuple(8, false), std::make_tuple(0, true), - std::make_tuple(1, true), std::make_tuple(2, true), std::make_tuple(3, true), - std::make_tuple(4, true), std::make_tuple(5, true), std::make_tuple(6, true), - std::make_tuple(7, true), std::make_tuple(8, true))); \ No newline at end of file diff --git a/thirdparty/CMakeLists.txt b/third-party/CMakeLists.txt similarity index 99% rename from thirdparty/CMakeLists.txt rename to third-party/CMakeLists.txt index e4c4ede3..9bf57311 100644 --- a/thirdparty/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -1,6 +1,5 @@ message(STATUS "Adding GoogleTest") - include(FetchContent) FetchContent_Declare( googletest